﻿:root {
  --primary: #1e3a8a;
  --primary-dark: #172554;
  --primary-light: #3b82f6;
  --accent: #c2410c;
  --accent-hover: #9a3412;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.08);
  --font-main: "Plus Jakarta Sans", "Noto Sans Ethiopic", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-main);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* Top Navigation */
.admin-nav {
  background: var(--primary-dark);
  color: white;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
}
.admin-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: white;
  font-weight: 700;
  font-size: 1.15rem;
}
.admin-logo-icon {
  background: var(--accent);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.admin-nav-user {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.9rem;
}
.btn-link-store {
  color: #93c5fd;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s;
}
.btn-link-store:hover { color: white; }
.btn-logout {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-logout:hover { background: var(--danger); border-color: var(--danger); }

/* Container */
.admin-container {
  max-width: 1280px;
  margin: 1.8rem auto;
  padding: 0 1.25rem;
}

/* Auth Screen */
.login-wrapper {
  max-width: 420px;
  margin: 5rem auto;
  background: var(--surface);
  padding: 2.2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.login-header {
  text-align: center;
  margin-bottom: 1.75rem;
}
.login-header h1 {
  font-size: 1.45rem;
  color: var(--primary-dark);
  margin-bottom: 0.35rem;
}
.login-header p {
  color: var(--text-muted);
  font-size: 0.88rem;
}
.form-group {
  margin-bottom: 1.15rem;
}
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.form-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.92rem;
  transition: border 0.2s;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.btn-primary {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }

/* Alert */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  display: none;
}
.alert-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid #fca5a5; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #86efac; }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  background: var(--surface);
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.stat-label { font-size: 0.82rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.stat-value { font-size: 1.85rem; font-weight: 800; color: var(--primary-dark); margin-top: 0.35rem; }
.stat-desc { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.25rem; }
.stat-pending .stat-value { color: var(--warning); }
.stat-approved .stat-value { color: var(--success); }

/* Navigation Tabs */
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}
.tab-btn {
  padding: 0.7rem 1.25rem;
  background: none;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  bottom: -2px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tab-btn.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}
.tab-badge {
  background: var(--warning);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 99px;
}

/* Actions Bar */
.actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.filter-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.4rem 0.85rem;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}
.filter-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.search-input {
  max-width: 320px;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

/* Table & Book Cards */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}
.book-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  position: relative;
}
.book-card-top {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.book-thumb {
  width: 70px;
  height: 95px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: #e2e8f0;
  flex-shrink: 0;
}
.book-card-info { flex: 1; min-width: 0; }
.book-card-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary-dark);
  line-height: 1.3;
  margin-bottom: 0.25rem;
}
.book-card-author {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.book-card-price {
  font-weight: 800;
  color: var(--accent);
  font-size: 1.1rem;
}
.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.badge-pending { background: var(--warning-bg); color: var(--warning); border: 1px solid #fcd34d; }
.badge-approved { background: var(--success-bg); color: var(--success); border: 1px solid #86efac; }
.badge-rejected { background: var(--danger-bg); color: var(--danger); border: 1px solid #fca5a5; }

/* Seller Info Box */
.seller-box {
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.82rem;
  margin-bottom: 0.85rem;
}
.seller-box-title { font-weight: 700; color: var(--primary); margin-bottom: 0.25rem; }
.seller-line { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.2rem; }
.seller-line a { color: var(--primary-light); text-decoration: none; font-weight: 600; }
.seller-line a:hover { text-decoration: underline; }

/* Book Card Actions */
.book-actions {
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.btn-action {
  flex: 1;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all 0.2s;
}
.btn-approve { background: var(--success); color: white; }
.btn-approve:hover { background: #15803d; }
.btn-reject { background: #f1f5f9; color: var(--text-muted); border: 1px solid var(--border); }
.btn-reject:hover { background: #e2e8f0; color: var(--danger); }
.btn-delete {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fca5a5;
  padding: 0.5rem 0.75rem;
}
.btn-delete:hover { background: var(--danger); color: white; }

/* Orders Table */
.orders-table-wrapper {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}
.orders-table th {
  background: #f8fafc;
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.orders-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.orders-table tr:hover { background: #f8fafc; }
.order-status-select {
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: white;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--surface);
  max-width: 440px;
  width: 100%;
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.modal-title { font-size: 1.15rem; font-weight: 700; color: var(--danger); margin-bottom: 0.5rem; }
.modal-body { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }
.btn-secondary {
  background: #e2e8f0;
  border: none;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--text);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 2000;
}
.toast.active { display: block; animation: fadeIn 0.2s; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}