/* MelakuStore - Admin Control Center Stylesheet (100% SVG, Zero Emojis) */

.admin-body {
  background-color: #f1f5f9;
  min-height: 100vh;
  display: flex;
}

.admin-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background: #111827;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  transition: var(--transition);
}

.sidebar-header {
  height: 72px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1e293b;
}

.sidebar-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-menu {
  list-style: none;
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: #94a3b8;
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
}

.sidebar-link:hover, .sidebar-link.active {
  background: #1e293b;
  color: #fff;
}

.sidebar-link.active {
  background: var(--primary);
}

.sidebar-footer {
  padding: 1.25rem;
  border-top: 1px solid #1e293b;
}

/* Main Content Wrapper */
.admin-main {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.admin-topbar {
  height: 72px;
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.admin-user-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-page);
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Admin Content Viewport */
.admin-content {
  padding: 2rem;
  flex: 1;
}

/* KPI Stat Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-blue { background: #e0e7ff; color: #4338ca; }
.stat-green { background: #dcfce7; color: #15803d; }
.stat-amber { background: #fef3c7; color: #b45309; }
.stat-purple { background: #f3e8ff; color: #7e22ce; }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
  margin-top: 0.2rem;
}

/* Data Tables */
.admin-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 2rem;
}

.admin-card-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  background: #f8fafc;
  padding: 0.85rem 1.25rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: #f8fafc;
}

.table-img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #e2e8f0;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--bg-page);
  color: var(--text-main);
}

.btn-icon.danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.75rem;
}

.modal-footer {
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: #f8fafc;
}

/* Responsive Admin */
@media (max-width: 992px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0;
  }
}

/* Dark Theme for Admin & Seller Dashboards */
[data-theme="dark"] body.admin-body {
  background-color: #090c12;
  color: #f8fafc;
}

[data-theme="dark"] .admin-topbar {
  background: #0f1624;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  color: #f8fafc;
}

[data-theme="dark"] .topbar-title {
  color: #f8fafc;
}

[data-theme="dark"] .admin-card {
  background: #0f1624;
  border-color: #1e293b;
  color: #f8fafc;
}

[data-theme="dark"] .admin-card-title {
  color: #f8fafc;
}

[data-theme="dark"] .stat-card {
  background: #0f1624;
  border-color: #1e293b;
  color: #f8fafc;
}

[data-theme="dark"] .stat-value {
  color: #f8fafc;
}

[data-theme="dark"] .stat-label {
  color: #94a3b8;
}

[data-theme="dark"] .data-table th {
  background: #162032;
  color: #94a3b8;
  border-color: #1e293b;
}

[data-theme="dark"] .data-table td {
  border-color: #1e293b;
  color: #f8fafc;
}

[data-theme="dark"] .data-table tbody tr:hover {
  background: #162032;
}

[data-theme="dark"] .admin-user-pill {
  background: #162032;
  color: #f8fafc;
  border-color: #334155;
}

[data-theme="dark"] .modal {
  background: #0f1624;
  color: #f8fafc;
  border-color: #1e293b;
}

[data-theme="dark"] .modal-header {
  border-bottom-color: #1e293b;
}

[data-theme="dark"] .modal-footer {
  background: #162032;
  border-top-color: #1e293b;
}
