/* ============================================================
   SFR MARKET — ADMİN PANEL STİLLERİ
   ============================================================ */

.admin-body {
  background: var(--bg-0);
  min-height: 100vh;
  font-family: 'Cairo', sans-serif;
}

.admin-body::before { display: none; }

/* ---------- LOGIN ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(800px 400px at 30% 20%, rgba(124, 92, 255, 0.2), transparent 60%),
    radial-gradient(600px 400px at 80% 80%, rgba(0, 224, 211, 0.15), transparent 60%);
}

.login-card {
  background: var(--bg-1);
  backdrop-filter: blur(30px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  position: relative;
  box-shadow: var(--shadow-strong);
  animation: modalIn 0.4s;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.login-card h1 {
  text-align: center;
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 8px;
  margin-top: 20px;
}

.login-card .sub {
  text-align: center;
  color: var(--text-2);
  font-size: 14px;
  margin-bottom: 32px;
}

.login-form .form-group {
  margin-bottom: 18px;
}

.login-form input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text);
  font-size: 15px;
  transition: var(--transition);
}

.login-form input:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.15);
}

.login-form .btn { width: 100%; margin-top: 8px; }

.login-error {
  background: rgba(255, 77, 109, 0.15);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  display: none;
}

.login-error.show { display: block; }

.login-hint {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  line-height: 1.6;
}

.login-hint code {
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--accent);
  font-family: monospace;
}

/* ---------- ADMIN LAYOUT ---------- */
.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--bg-1);
  border-left: 1px solid var(--border);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 20px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.admin-logo .logo-mark { width: 40px; height: 40px; font-size: 20px; }
.admin-logo .name { font-weight: 800; font-size: 17px; }
.admin-logo .sub { font-size: 11px; color: var(--text-3); }

.admin-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-2);
  transition: var(--transition);
}

.admin-menu-item:hover {
  background: var(--surface);
  color: var(--text);
}

.admin-menu-item.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.3);
}

.admin-menu-item .icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.admin-menu-item .badge {
  margin-right: auto;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 100px;
  min-width: 22px;
  text-align: center;
}

.admin-sidebar-foot {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.admin-main {
  padding: 32px;
  min-width: 0;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.admin-page-title h2 {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 4px;
}

.admin-page-title .sub {
  color: var(--text-2);
  font-size: 14px;
}

.admin-actions {
  display: flex;
  gap: 10px;
}

.admin-mobile-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* ---------- STATS CARDS ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: var(--stat-color, var(--primary));
  opacity: 0.15;
  border-radius: 50%;
  filter: blur(30px);
}

.stat-card .icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--surface-2);
  margin-bottom: 14px;
  color: var(--stat-color, var(--primary));
}

.stat-card .num {
  font-size: 30px;
  font-weight: 900;
  margin-bottom: 4px;
}

.stat-card .label {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 600;
}

/* ---------- PANELS ---------- */
.admin-panel {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.panel-head h3 {
  font-size: 18px;
  font-weight: 800;
}

.panel-head .actions {
  display: flex;
  gap: 8px;
}

/* ---------- TABLES ---------- */
.admin-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th {
  background: var(--bg-2);
  padding: 14px 16px;
  text-align: right;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr:hover { background: var(--surface-2); }

.admin-table .product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-table .product-img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 18px;
  overflow: hidden;
  flex-shrink: 0;
}

.admin-table .product-img img { width: 100%; height: 100%; object-fit: cover; }

.admin-table .name { font-weight: 700; }
.admin-table .desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}

.badge-success { background: rgba(32, 201, 151, 0.2); color: var(--success); }
.badge-warning { background: rgba(255, 170, 0, 0.2); color: var(--warning); }
.badge-danger { background: rgba(255, 77, 109, 0.2); color: var(--danger); }
.badge-info { background: rgba(0, 224, 211, 0.2); color: var(--accent); }
.badge-primary { background: rgba(124, 92, 255, 0.2); color: var(--primary); }
.badge-mute { background: var(--surface-2); color: var(--text-3); }

.row-actions {
  display: flex;
  gap: 6px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  transition: var(--transition);
}

.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger); color: white; }
.icon-btn.success:hover { background: var(--success); color: white; }

/* ---------- FILTERS ---------- */
.filters-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 240px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
}

.search-input:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.15);
}

.filter-select {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

/* ---------- FORM MODAL ---------- */
.form-modal {
  max-width: 600px;
}

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

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

.image-upload {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-2);
}

.image-upload:hover {
  border-color: var(--primary);
  background: var(--surface);
}

.image-upload input[type="file"] { display: none; }

.image-upload .upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
  color: var(--primary);
}

.image-upload .upload-text {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.image-upload .upload-hint {
  font-size: 12px;
  color: var(--text-3);
}

.image-preview {
  display: none;
  margin-top: 12px;
  text-align: center;
}

.image-preview img {
  max-width: 200px;
  max-height: 150px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-2);
  border-radius: 10px;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-group label {
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.modal-actions .btn { flex: 1; }

/* ---------- TABS ---------- */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.tab {
  padding: 12px 20px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.tab:hover { color: var(--text); }

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- ORDER DETAIL ---------- */
.order-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.order-section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.order-section h4 {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
}

.order-info-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}

.order-info-row .label { color: var(--text-3); }
.order-info-row .value { font-weight: 700; }

.order-items-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: 8px;
  font-size: 13px;
}

.order-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.order-actions .btn { flex: 1; }

/* ---------- PAYMENT METHODS ---------- */
.payment-methods-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.payment-method-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.payment-method-card.active {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(32, 201, 151, 0.15);
}

.payment-method-card .qr-preview {
  width: 100%;
  height: 200px;
  background: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
}

.payment-method-card .qr-preview img {
  max-width: 100%;
  max-height: 100%;
}

.payment-method-card .qr-preview .placeholder {
  color: var(--text-mute);
  text-align: center;
  font-size: 13px;
}

.payment-method-card h4 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 8px;
}

.payment-method-card p {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 16px;
  line-height: 1.6;
}

.payment-method-card .actions {
  display: flex;
  gap: 8px;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .order-detail { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 260px;
    z-index: 200;
    transform: translateX(100%);
    transition: var(--transition);
  }
  body[dir="rtl"] .admin-sidebar { transform: translateX(100%); }
  body[dir="rtl"] .admin-sidebar.open { transform: translateX(0); }

  .admin-mobile-toggle { display: flex; }
  .admin-main { padding: 20px; }
  .form-modal .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
  backdrop-filter: blur(4px);
}

.sidebar-overlay.open { display: block; }