/* admin.css - Admin Operations CMS Console Styling */
:root {
  --bg-dark: #090d16;
  --bg-sidebar: #05080f;
  --bg-card: #0f172a;
  --bg-hover: #1e293b;
  --primary-blue: #2563eb;
  --accent-cyan: #38bdf8;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --green: #22c55e;
  --orange: #f97316;
  --purple: #a855f7;
  --red: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background: var(--bg-dark);
  color: var(--text-main);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-num {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
}

.brand-word {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-cyan);
}

.brand-badge {
  background: var(--primary-blue);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: #fff;
}

.nav-item.active {
  background: var(--primary-blue);
  color: #fff;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.preview-client-link {
  color: var(--accent-cyan);
  font-size: 12px;
  text-decoration: none;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Main Area */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-topbar {
  height: 70px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(10px);
}

.page-title-area h1 {
  font-size: 20px;
  font-weight: 800;
}

.page-title-area .subtext {
  font-size: 12px;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.system-status {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.admin-content-container {
  flex: 1;
  padding: 24px 32px;
  overflow-y: auto;
}

/* Sections */
.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

/* Cards & Layout */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.icon-blue { background: rgba(37, 99, 235, 0.15); color: #3b82f6; }
.icon-purple { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.icon-cyan { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.icon-orange { background: rgba(249, 115, 22, 0.15); color: #f97316; }

.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}

.kpi-value {
  font-size: 22px;
  font-weight: 800;
  display: block;
  margin: 2px 0;
}

.kpi-trend {
  font-size: 11px;
  font-weight: 600;
}

.dashboard-split-row {
  display: flex;
  gap: 20px;
}

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

.flex-1 { flex: 1; }

.card-header {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 700;
}

/* Data Tables */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: #cbd5e1;
}

.data-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.badge-green { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-orange { background: rgba(249, 115, 22, 0.15); color: #fb923c; }

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s;
}

.btn:hover { opacity: 0.9; }
.btn-primary { background: var(--primary-blue); color: #fff; }
.btn-secondary { background: #334155; color: #fff; }
.btn-sm { padding: 4px 8px; font-size: 11px; }
.btn-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.search-filter-group {
  display: flex;
  gap: 12px;
}

.search-filter-group input, .search-filter-group select {
  background: #1e293b;
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}

/* Quick Actions List */
.quick-actions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: #1e293b;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.action-tile:hover {
  background: #334155;
  transform: translateX(4px);
}

.action-tile i {
  font-size: 22px;
}

.action-tile strong {
  display: block;
  font-size: 13px;
}

.action-tile small {
  color: var(--text-muted);
}

/* Forms */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: #1e293b;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  outline: none;
}

.form-row {
  display: flex;
  gap: 12px;
}

.code-textarea {
  font-family: monospace;
  font-size: 12px;
  background: #020617;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: #a5f3fc;
  padding: 14px;
  width: 100%;
  resize: vertical;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  width: 90%;
  max-width: 520px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.category-reorder-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #1e293b;
  border-radius: 8px;
  border-left: 4px solid #3b82f6;
}

.text-green { color: var(--green); }
.text-orange { color: var(--orange); }
.text-purple { color: var(--purple); }
.text-cyan { color: var(--accent-cyan); }
