:root {
  --primary: #1a365d;
  --primary-dark: #0f2744;
  --accent: #c9a227;
  --accent-hover: #b08d1e;
  --text: #1a202c;
  --text-muted: #4a5568;
  --bg: #f7fafc;
  --white: #ffffff;
  --border: #e2e8f0;
  --success: #276749;
  --warning: #c05621;
  --danger: #c53030;
  --radius: 8px;
  --shadow: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 0; gap: 1rem; flex-wrap: wrap;
}
.logo { font-size: 1.35rem; font-weight: 700; color: var(--primary); }
.logo span { color: var(--accent); }
.brand-logo { display: inline-flex; align-items: center; flex: 0 0 auto; line-height: 0; }
.brand-logo img { width: 270px; height: auto; }
.nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.nav a { color: var(--text-muted); font-weight: 500; font-size: 0.95rem; }
.nav a:hover, .nav a.active { color: var(--primary); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.6rem 1.25rem; border-radius: var(--radius);
  font-weight: 600; font-size: 0.95rem; border: none; cursor: pointer;
  transition: all 0.15s ease; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-accent { background: var(--accent); color: var(--primary-dark); }
.btn-accent:hover { background: var(--accent-hover); color: var(--primary-dark); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; padding: 3.5rem 0; text-align: center;
}
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; margin-bottom: 0.75rem; }
.hero p { font-size: 1.15rem; opacity: 0.9; max-width: 560px; margin: 0 auto 1.75rem; }
.section { padding: 3rem 0; }
.section-title { font-size: 1.6rem; font-weight: 700; color: var(--primary); margin-bottom: 1.5rem; text-align: center; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.section-header h2 { margin: 0; text-align: left; }
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}
.book-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column;
}
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.book-cover { aspect-ratio: 2/3; background: #edf2f7; overflow: hidden; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-cover.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 0.85rem; padding: 1rem; text-align: center;
}
.book-info { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.book-info h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; line-height: 1.3; }
.book-info .author { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.book-info .category {
  font-size: 0.75rem; color: var(--accent); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.5rem;
}
.book-info .price { font-size: 1.1rem; font-weight: 700; color: var(--primary); margin-top: auto; padding-top: 0.5rem; }
.book-info .btn { width: 100%; margin-top: 0.75rem; }
.cat-list { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-bottom: 2rem; }
.cat-chip {
  padding: 0.4rem 1rem; background: var(--white); border: 1px solid var(--border);
  border-radius: 999px; font-size: 0.9rem; font-weight: 500; color: var(--text-muted);
}
.cat-chip:hover, .cat-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.filters { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; align-items: center; }
.filters input, .filters select {
  padding: 0.5rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.95rem;
}
.filters input { min-width: 200px; flex: 1; }
.book-detail {
  display: grid; grid-template-columns: 280px 1fr; gap: 2.5rem;
  background: var(--white); padding: 2rem; border-radius: var(--radius); box-shadow: var(--shadow);
}
@media (max-width: 700px) { .book-detail { grid-template-columns: 1fr; } }
.book-detail-cover { aspect-ratio: 2/3; background: #edf2f7; border-radius: var(--radius); overflow: hidden; }
.book-detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-detail-meta h1 { font-size: 1.8rem; color: var(--primary); margin-bottom: 0.35rem; }
.book-detail-meta .author { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.book-detail-meta .price { font-size: 1.6rem; font-weight: 700; color: var(--primary); margin: 1rem 0; }
.book-detail-meta .desc { color: var(--text-muted); margin-bottom: 1.5rem; white-space: pre-line; }
.form-card {
  background: var(--white); padding: 2rem; border-radius: var(--radius);
  box-shadow: var(--shadow); max-width: 520px; margin: 0 auto;
}
.form-group { margin-bottom: 1.15rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.35rem; font-size: 0.9rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 0.65rem 0.9rem; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 1rem; font-family: inherit;
}
.form-group textarea { min-height: 120px; resize: vertical; }
.alert {
  padding: 0.85rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.95rem;
}
.alert-error { background: #fff5f5; color: var(--danger); border: 1px solid #feb2b2; }
.alert-success { background: #f0fff4; color: var(--success); border: 1px solid #9ae6b4; }
.alert-info { background: #ebf8ff; color: #2b6cb0; border: 1px solid #90cdf4; }
.alert-warning { background: #fffaf0; color: var(--warning); border: 1px solid #fbd38d; }
.status-card {
  background: var(--white); padding: 2rem; border-radius: var(--radius);
  box-shadow: var(--shadow); max-width: 640px; margin: 0 auto;
}
.status-badge {
  display: inline-block; padding: 0.3rem 0.85rem; border-radius: 999px;
  font-size: 0.85rem; font-weight: 600; text-transform: uppercase;
}
.status-pending { background: #fefcbf; color: #975a16; }
.status-confirmed { background: #c6f6d5; color: #22543d; }
.status-failed, .status-cancelled { background: #fed7d7; color: #742a2a; }
.payment-methods { margin-top: 1.5rem; display: grid; gap: 1rem; }
.payment-method {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.15rem; background: #f8fafc;
}
.payment-method h4 { margin-bottom: 0.35rem; color: var(--primary); }
.ref { font-family: ui-monospace, monospace; background: #edf2f7; padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 600; }
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 60px); }
@media (max-width: 800px) { .admin-layout { grid-template-columns: 1fr; } }
.admin-sidebar { background: var(--primary-dark); color: #fff; padding: 1.5rem 0; }
.admin-sidebar a {
  display: block; padding: 0.7rem 1.5rem; color: rgba(255,255,255,0.8); font-weight: 500;
}
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,0.1); color: #fff; }
.admin-content { padding: 1.75rem; }
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.stat-card {
  background: var(--white); padding: 1.25rem; border-radius: var(--radius);
  box-shadow: var(--shadow); text-align: center;
}
.stat-card .num { font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.stat-card .label { font-size: 0.85rem; color: var(--text-muted); }
table {
  width: 100%; border-collapse: collapse; background: var(--white);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
th, td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
th { background: #edf2f7; font-weight: 600; color: var(--primary); }
tr:last-child td { border-bottom: none; }
.site-footer {
  margin-top: auto; background: var(--primary-dark); color: rgba(255,255,255,0.85);
  padding: 2.5rem 0 1.5rem;
}
.footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem; margin-bottom: 2rem;
}
.footer-grid h4 { color: #fff; margin-bottom: 0.75rem; font-size: 1rem; }
.footer-grid a { color: rgba(255,255,255,0.75); display: block; margin-bottom: 0.35rem; }
.footer-grid a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15); padding-top: 1.25rem;
  text-align: center; font-size: 0.9rem; opacity: 0.8;
}
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }

/* Password show/hide eye toggle */
.password-wrap {
  position: relative;
  display: block;
}
.password-wrap input {
  width: 100%;
  padding-right: 2.75rem;
  box-sizing: border-box;
}
.password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 0.35rem;
  cursor: pointer;
  color: var(--text-muted, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.password-toggle:hover {
  color: var(--primary, #1e3a5f);
}
.password-toggle:focus {
  outline: 2px solid var(--primary, #1e3a5f);
  outline-offset: 2px;
  border-radius: 4px;
}
