:root {
  --bg: #020617;
  --bg-card: #020617;
  --bg-elevated: #020617;
  --bg-input: #020617;
  --border-soft: #111827;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --accent-green: #22c55e;
  --accent-blue: #0ea5e9;
  --danger: #ef4444;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-soft: 0 0 40px rgba(34, 197, 94, 0.2);
}

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

body {
  background: radial-gradient(circle at top, #022c22 0, #020617 45%, #000 100%);
  color: var(--text-main);
  min-height: 100vh;
}

/* HEADER */

.main-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 40px;
  background: linear-gradient(to bottom, #000, #020617 80%, transparent);
  border-bottom: 1px solid #020617;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-circle {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #a7f3d0, #22c55e, #0ea5e9);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.7);
}

.logo-circle img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.header-text .site-name {
  font-size: 1.2rem;
  font-weight: 600;
}

.header-text .site-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user-name {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* BUTTONS */

.nav-btn,
.link-btn {
  border: none;
  outline: none;
  cursor: pointer;
  border-radius: var(--radius-pill);
  padding: 6px 18px;
  font-size: 0.85rem;
  background: #020617;
  color: var(--text-main);
  border: 1px solid #111827;
}

.nav-btn.primary {
  background: #10b981;
  border-color: #10b981;
  color: #022c22;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.7);
}

.nav-btn.danger {
  border-color: var(--danger);
  color: var(--danger);
}

.nav-btn:hover {
  border-color: #0ea5e9;
}

.link-btn {
  background: transparent;
  color: var(--accent-blue);
  padding: 0;
  border: none;
}

.btn-gradient {
  width: 100%;
  border-radius: var(--radius-pill);
  border: none;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 500;
  background: linear-gradient(to right, #22c55e, #0ea5e9);
  color: #022c22;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.7);
}

/* LAYOUT */

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 16px 60px;
}

.section {
  margin-top: 16px;
}

.section-title {
  font-size: 1.6rem;
  margin-bottom: 16px;
}

.section-center {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.library-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.hidden {
  display: none !important;
}

/* AUTH CARD */

.auth-card {
  width: 100%;
  max-width: 480px;
  background: radial-gradient(circle at top, #052e16 0, #020617 55%, #000 100%);
  border-radius: var(--radius-lg);
  padding: 26px 26px 30px;
  box-shadow: var(--shadow-soft);
  border: 1px solid #022c22;
}

.auth-title {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form.small {
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: block;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  padding: 8px 14px;
  color: var(--text-main);
  font-size: 0.9rem;
}

textarea {
  border-radius: 12px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.6);
}

.small-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.msg {
  margin-top: 6px;
  font-size: 0.8rem;
}

.msg.error {
  color: #fecaca;
}

.msg.success {
  color: #bbf7d0;
}

/* CARDS GRID */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.card,
.book-card {
  background: #020617;
  border-radius: var(--radius-lg);
  border: 1px solid #020617;
  box-shadow: 0 0 20px rgba(15, 23, 42, 0.9);
  padding: 12px 12px 10px;
}

/* book blocks made smaller */
.book-card {
  max-width: 340px;
}

.book-card-img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 8px;
}

.book-title {
  font-weight: 600;
  font-size: 0.98rem;
  margin-bottom: 2px;
}

.book-price {
  font-size: 0.88rem;
  color: var(--accent-green);
  margin-bottom: 2px;
}

.book-author-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.book-author-value {
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.book-description {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  max-height: 70px;       /* important: small block */
  overflow-y: auto;
}

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

.card-btn {
  border-radius: var(--radius-pill);
  border: 1px solid #111827;
  background: #020617;
  color: var(--text-main);
  padding: 5px 12px;
  font-size: 0.8rem;
  cursor: pointer;
}

.card-btn.buy {
  background: linear-gradient(to right, #22c55e, #0ea5e9);
  border: none;
  color: #022c22;
}

.card-btn[disabled] {
  opacity: 0.5;
  cursor: default;
}

/* ADMIN */

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 20px;
}

.card-title {
  margin-bottom: 10px;
  font-weight: 600;
}

.mt-12 {
  margin-top: 12px;
}
.mt-24 {
  margin-top: 24px;
}

.form-row {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.admin-list-item {
  font-size: 0.85rem;
  border-radius: 12px;
  border: 1px solid #111827;
  padding: 8px 10px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-list-buttons {
  display: flex;
  gap: 6px;
}

.tag {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid #1f2937;
}

.tag.pending {
  color: #facc15;
}
.tag.approved {
  color: #22c55e;
}
.tag.rejected {
  color: #f87171;
}

/* MODAL */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal {
  width: 95%;
  max-width: 520px;
  background: #020617;
  border-radius: 18px;
  padding: 18px 18px 16px;
  border: 1px solid #111827;
  box-shadow: 0 0 30px rgba(15, 23, 42, 0.9);
}

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

.modal-title {
  font-size: 1.1rem;
}

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

.modal-body {
  font-size: 0.9rem;
}

.bank-pill {
  border-radius: 14px;
  border: 1px solid #1f2937;
  padding: 8px 10px;
  margin-bottom: 8px;
  cursor: pointer;
}

.bank-pill.active {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.5);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

/* RESPONSIVE */

@media (max-width: 768px) {
  .main-header {
    padding: 10px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 20px 18px 22px;
  }
}
