@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; font-size: 15px; color: #2C1A22; background: #FAF7F8; line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }

/* ── NAV ── */
.nav { background: #fff; border-bottom: 2px solid #D4537E; position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: 1100px; margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-circle { width: 38px; height: 38px; border-radius: 50%; background: #D4537E; color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-brand { font-size: 15px; font-weight: 600; color: #4B1528; line-height: 1.2; }
.nav-sub { font-size: 9px; color: #D4537E; text-transform: uppercase; letter-spacing: 1.5px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link { padding: 6px 14px; border-radius: 6px; text-decoration: none; font-size: 13.5px; font-weight: 500; color: #72243E; transition: background .15s, color .15s; }
.nav-link:hover, .nav-link.active { background: #FBEAF0; color: #4B1528; }
.nav-logout { color: #999; }
.nav-logout:hover { background: #fff0f0; color: #c0392b; }
.nav-label { font-size: 13px; font-weight: 600; color: #4B1528; padding: 0 10px; }

/* ── FLASH MESSAGES ── */
.flash-wrap { max-width: 900px; margin: 16px auto 0; padding: 0 20px; }
.flash { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 8px; }
.flash-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.flash-error   { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
.flash-warning { background: #fff8e1; color: #f57f17; border: 1px solid #ffecb3; }
.flash-info    { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; }

/* ── MAIN LAYOUT ── */
.main { flex: 1; max-width: 900px; width: 100%; margin: 32px auto; padding: 0 20px; }
.main-wide { flex: 1; max-width: 1100px; width: 100%; margin: 32px auto; padding: 0 20px; }

/* ── CARDS ── */
.card { background: #fff; border: 1px solid #F4C0D1; border-radius: 12px; padding: 28px 32px; margin-bottom: 24px; }
.card-sm { padding: 20px 24px; }

/* ── HERO BAND ── */
.hero { background: #FBEAF0; border-left: 4px solid #D4537E; border-radius: 0 10px 10px 0; padding: 16px 20px; margin-bottom: 24px; }
.hero-title { font-size: 17px; font-weight: 600; color: #4B1528; margin-bottom: 4px; }
.hero-sub { font-size: 13.5px; color: #72243E; font-style: italic; }

/* ── TYPOGRAPHY ── */
h1 { font-size: 22px; font-weight: 700; color: #4B1528; margin-bottom: 6px; }
h2 { font-size: 17px; font-weight: 600; color: #4B1528; margin-bottom: 12px; }
h3 { font-size: 14px; font-weight: 600; color: #4B1528; margin-bottom: 8px; }
p  { font-size: 14px; color: #555; margin-bottom: 8px; }

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 18px; }
label { display: block; font-size: 13px; font-weight: 600; color: #4B1528; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 10px 14px; border: 1px solid #F4C0D1; border-radius: 8px;
  font-size: 14.5px; font-family: inherit; color: #2C1A22; background: #fff;
  transition: border-color .15s, box-shadow .15s; outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: #D4537E; box-shadow: 0 0 0 3px rgba(212,83,126,.12);
}
input::placeholder { color: #bbb; }
.form-hint { font-size: 11.5px; color: #999; margin-top: 4px; }
.form-error { font-size: 12px; color: #c62828; margin-top: 4px; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; border-radius: 8px; font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer; border: none; transition: background .15s, transform .1s; text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primary { background: #D4537E; color: #fff; }
.btn-primary:hover { background: #b83e65; }
.btn-secondary { background: #FBEAF0; color: #4B1528; border: 1px solid #F4C0D1; }
.btn-secondary:hover { background: #F4C0D1; }
.btn-danger { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
.btn-danger:hover { background: #c62828; color: #fff; }
.btn-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.btn-success:hover { background: #2e7d32; color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 12.5px; }
.btn-full { width: 100%; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ── PLAN CARDS ── */
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.plan-card { border: 2px solid #F4C0D1; border-radius: 10px; padding: 16px; cursor: pointer; transition: border-color .15s, background .15s; position: relative; }
.plan-card:hover { border-color: #D4537E; background: #FDF6F9; }
.plan-card.selected { border-color: #D4537E; background: #FBEAF0; }
.plan-card.selected::after { content: "✓"; position: absolute; top: 10px; right: 12px; color: #D4537E; font-weight: 700; font-size: 15px; }
.plan-name  { font-weight: 700; color: #4B1528; font-size: 14px; margin-bottom: 2px; }
.plan-price { font-size: 20px; font-weight: 700; color: #D4537E; margin-bottom: 4px; }
.plan-price span { font-size: 12px; color: #999; font-weight: 400; }
.plan-badge { display: inline-block; background: #FBEAF0; color: #72243E; border: 0.5px solid #F4C0D1; border-radius: 4px; font-size: 11px; padding: 2px 8px; font-weight: 500; margin-bottom: 4px; }
.plan-desc  { font-size: 12px; color: #888; }

/* ── STATUS BADGES ── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 600; }
.badge-valid     { background: #e8f5e9; color: #2e7d32; }
.badge-pending   { background: #fff8e1; color: #f57f17; }
.badge-expired   { background: #f5f5f5; color: #757575; }
.badge-suspended { background: #ffebee; color: #c62828; }
.badge-rejected  { background: #fce4ec; color: #880e4f; }
.badge-invalid   { background: #ffebee; color: #c62828; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { background: #FBEAF0; color: #4B1528; font-weight: 600; padding: 10px 14px; text-align: left; border-bottom: 1px solid #F4C0D1; white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid #f8edf2; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FDF6F9; }
.td-muted { color: #aaa; font-style: italic; }

/* ── TABS ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid #F4C0D1; margin-bottom: 20px; flex-wrap: wrap; }
.tab { padding: 8px 18px; font-size: 13.5px; font-weight: 500; color: #999; border-radius: 8px 8px 0 0; cursor: pointer; text-decoration: none; border: 1px solid transparent; border-bottom: none; position: relative; top: 1px; transition: color .15s; }
.tab.active { color: #4B1528; background: #fff; border-color: #F4C0D1; font-weight: 600; }
.tab:hover:not(.active) { color: #D4537E; }
.tab-badge { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; background: #D4537E; color: #fff; border-radius: 50%; font-size: 10px; margin-left: 4px; }

/* ── STAT CARDS ── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid #F4C0D1; border-radius: 10px; padding: 16px 20px; }
.stat-label { font-size: 12px; color: #999; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.stat-value { font-size: 28px; font-weight: 700; color: #4B1528; }
.stat-value.pink { color: #D4537E; }
.stat-value.amber { color: #e67e22; }
.stat-value.green { color: #27ae60; }

/* ── CALLOUT ── */
.callout { border: 1px solid #F4C0D1; border-radius: 8px; padding: 12px 16px; font-size: 13.5px; background: #FDF6F9; margin: 12px 0; }
.callout-warn { border-color: #FAC775; background: #FAEEDA; }
.callout-info { border-color: #B5D4F4; background: #E6F1FB; }
.callout-success { border-color: #c8e6c9; background: #e8f5e9; }

/* ── PIN INPUT ── */
.pin-wrap { display: flex; gap: 8px; justify-content: center; margin: 20px 0; }
.pin-wrap input { width: 46px; height: 54px; text-align: center; font-size: 22px; font-weight: 700; padding: 0; border: 2px solid #F4C0D1; border-radius: 8px; }
.pin-wrap input:focus { border-color: #D4537E; }

/* ── MEMBER PASS ── */
.pass-card { border: 2px solid #D4537E; border-radius: 16px; padding: 24px; text-align: center; max-width: 380px; margin: 0 auto; }
.pass-qr { margin: 16px auto; max-width: 180px; }
.pass-qr img { width: 100%; border-radius: 8px; border: 1px solid #F4C0D1; }
.pass-name { font-size: 20px; font-weight: 700; color: #4B1528; margin-bottom: 4px; }
.pass-plan { font-size: 14px; color: #D4537E; font-weight: 600; margin-bottom: 12px; }
.pass-info { display: flex; justify-content: space-around; background: #FBEAF0; border-radius: 8px; padding: 12px; margin: 12px 0; }
.pass-info-item { text-align: center; }
.pass-info-label { font-size: 10px; color: #999; text-transform: uppercase; letter-spacing: .5px; }
.pass-info-val { font-size: 16px; font-weight: 700; color: #4B1528; }
.expiry-warn { background: #fff8e1; border: 1px solid #FAC775; border-radius: 8px; padding: 10px 14px; font-size: 13px; color: #f57f17; font-weight: 500; margin: 8px 0; }

/* ── SCANNER ── */
.scanner-wrap { max-width: 500px; margin: 0 auto; }
#reader { border-radius: 12px; overflow: hidden; border: 2px solid #D4537E; }
.scan-result { border-radius: 12px; padding: 20px; text-align: center; margin: 16px 0; display: none; }
.scan-result.valid   { background: #e8f5e9; border: 2px solid #a5d6a7; }
.scan-result.invalid { background: #ffebee; border: 2px solid #ef9a9a; }
.scan-result .scan-icon { font-size: 40px; margin-bottom: 8px; }
.scan-result .scan-name { font-size: 20px; font-weight: 700; color: #2C1A22; }
.scan-result .scan-detail { font-size: 14px; color: #666; margin-top: 4px; }
.manual-lookup { background: #fff; border: 1px solid #F4C0D1; border-radius: 10px; padding: 16px; margin-top: 16px; }
.search-results-list { border: 1px solid #F4C0D1; border-radius: 8px; background: #fff; max-height: 200px; overflow-y: auto; }
.search-result-item { padding: 10px 14px; cursor: pointer; font-size: 14px; border-bottom: 1px solid #f8edf2; }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: #FBEAF0; }
.search-result-item .sname { font-weight: 600; color: #4B1528; }
.search-result-item .splan { font-size: 12px; color: #D4537E; }
.search-result-item .sstatus { font-size: 11px; color: #aaa; float: right; }

/* ── ADMIN MEMBER PAGE ── */
.member-header { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.member-avatar { width: 56px; height: 56px; border-radius: 50%; background: #D4537E; color: #fff; font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #f8edf2; font-size: 13.5px; }
.field-row:last-child { border-bottom: none; }
.field-label { color: #999; font-weight: 500; }
.field-val { color: #2C1A22; font-weight: 500; }

/* ── MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 999; padding: 16px; }
.modal-box { background: #fff; border-radius: 14px; padding: 28px; max-width: 400px; width: 100%; }
.modal-title { font-size: 17px; font-weight: 700; color: #4B1528; margin-bottom: 12px; }

/* ── UTILS ── */
.text-muted { color: #aaa; }
.text-pink  { color: #D4537E; }
.text-dark  { color: #4B1528; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.inline-form { display: inline; }

/* ── FOOTER ── */
.site-footer { background: #fff; border-top: 1px solid #F4C0D1; padding: 16px 20px; margin-top: auto; }
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; font-size: 12.5px; color: #aaa; flex-wrap: wrap; gap: 4px; }
.footer-inner strong { color: #D4537E; }

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  .plan-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .nav-inner { padding: 0 14px; }
  .main { padding: 0 14px; margin-top: 20px; }
  .card { padding: 20px 16px; }
  .nav-link { padding: 6px 10px; font-size: 13px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .pass-info { flex-direction: column; gap: 8px; }
}
