/* ===== TSBambooStore — Main Stylesheet ===== */
:root {
  --bg: #080c12; --bg2: #0d1320; --bg3: #111827;
  --surface: #141d2e; --surface2: #1a2540; --border: #1e2d47;
  --accent: #00d4ff; --accent2: #7c3aed; --accent3: #10b981;
  --red: #ef4444; --yellow: #f59e0b;
  --text: #e2e8f0; --text2: #94a3b8; --text3: #4a5568;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,.025) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none; z-index: 0;
}

/* ── Typography ──────────────────────────────────────────────────────────── */
h1,h2,h3,h4,h5 { font-weight: 600; line-height: 1.3; }
a { color: var(--accent); text-decoration: none; }
a:hover { opacity: .85; }
.serif { font-family: 'Instrument Serif', serif; }
.mono { font-family: 'DM Mono', monospace; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.pos-rel { position: relative; z-index: 1; }

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.nav-logo img {
    height: 32px;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .nav-logo img {
        height: 28px;
    }
}

.navbar {
  position: sticky; top: 0; z-index: 200;
  background: rgba(8,12,18,.93);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  height: 60px;
}
.navbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 1.5rem;
  height: 100%; display: flex; align-items: center; gap: 1rem;
}
.nav-logo {
  font-family: 'Instrument Serif', serif; font-style: italic;
  font-size: 1.5rem; font-weight: 400;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  flex-shrink: 0;
}
.nav-links {
  display: flex; gap: 2px; align-items: center;
  flex: 1; justify-content: center;
}
.nav-links a {
  color: var(--text2); font-size: .82rem; font-weight: 500;
  padding: 7px 13px; border-radius: 9px;
  display: flex; align-items: center; gap: 7px;
  transition: background .16s, color .16s; white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  background: rgba(0,212,255,.09); color: var(--accent);
}
.nav-actions { display: flex; gap: .6rem; align-items: center; flex-shrink: 0; }
.nav-balance {
  font-family: 'DM Mono', monospace; font-size: .78rem;
  background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.25);
  color: #34d399; border-radius: 8px; padding: 5px 10px;
}
.nav-username {
  font-size: .82rem; color: var(--text2); font-weight: 500;
}
.nav-hamburger {
  display: none; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; color: var(--text2); cursor: pointer;
  align-items: center; justify-content: center; font-size: 1.1rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 10px; padding: 9px 18px;
  font-family: inherit; font-size: .84rem; font-weight: 600;
  cursor: pointer; transition: all .18s; border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), #009fcc); border: none; color: var(--bg); }
.btn-primary:hover { opacity: .88; transform: translateY(-1px); }
.btn-purple { background: linear-gradient(135deg, var(--accent2), #a855f7); border: none; color: #fff; }
.btn-purple:hover { opacity: .9; transform: translateY(-1px); }
.btn-ghost { background: var(--surface2); border-color: var(--border); color: var(--text2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.3); color: #f87171; }
.btn-danger:hover { background: rgba(239,68,68,.2); }
.btn-success { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.3); color: #34d399; }
.btn-success:hover { background: rgba(16,185,129,.2); }
.btn-sm { padding: 5px 11px; font-size: .75rem; border-radius: 7px; }
.btn-icon { padding: 7px; border-radius: 8px; }

/* ── Cards / Panels ──────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 15px; overflow: hidden;
}
.card-header {
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: .9rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 1.25rem; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: .73rem; color: var(--text2); font-weight: 500; margin-bottom: 5px; letter-spacing: .3px; }
.form-control {
  width: 100%; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 9px; padding: 10px 13px; color: var(--text);
  font-family: inherit; font-size: .84rem; outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,212,255,.07); }
.form-control::placeholder { color: var(--text3); }
select.form-control option { background: var(--bg3); }
textarea.form-control { resize: vertical; min-height: 100px; font-family: 'DM Mono', monospace; font-size: .78rem; line-height: 1.8; }
.form-error { color: #f87171; font-size: .72rem; margin-top: 4px; }
.form-hint { color: var(--text3); font-size: .71rem; margin-top: 3px; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%; border-collapse: collapse; font-size: .82rem;
}
.table th {
  text-align: left; padding: 10px 14px;
  background: var(--bg3); color: var(--text2);
  font-size: .71rem; font-weight: 600; letter-spacing: .4px; text-transform: uppercase;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid rgba(30,45,71,.5); color: var(--text); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255,255,255,.018); }
.table .mono { font-family: 'DM Mono', monospace; font-size: .78rem; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: .67rem; font-weight: 600; font-family: 'DM Mono', monospace; letter-spacing: .3px;
}
.badge-success { background: rgba(16,185,129,.15); color: #34d399; border: 1px solid rgba(16,185,129,.25); }
.badge-danger  { background: rgba(239,68,68,.15); color: #f87171; border: 1px solid rgba(239,68,68,.25); }
.badge-warning { background: rgba(245,158,11,.15); color: #fbbf24; border: 1px solid rgba(245,158,11,.25); }
.badge-info    { background: rgba(0,212,255,.1); color: var(--accent); border: 1px solid rgba(0,212,255,.22); }
.badge-purple  { background: rgba(124,58,237,.15); color: #a78bfa; border: 1px solid rgba(124,58,237,.25); }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert { padding: .85rem 1.1rem; border-radius: 11px; font-size: .82rem; margin-bottom: 1rem; display: flex; align-items: flex-start; gap: 8px; }
.alert-success { background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.25); color: #34d399; }
.alert-danger  { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.25); color: #f87171; }
.alert-info    { background: rgba(0,212,255,.06); border: 1px solid rgba(0,212,255,.2); color: var(--accent); }
.alert-warning { background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.25); color: #fbbf24; }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination { display: flex; gap: .35rem; align-items: center; }
.page-link {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 11px;
  color: var(--text2); font-size: .79rem; cursor: pointer;
  transition: all .15s; text-decoration: none;
}
.page-link:hover, .page-link.active { border-color: var(--accent); color: var(--accent); }
.page-link.disabled { opacity: .35; pointer-events: none; }

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: .35rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tab-link {
  padding: 9px 16px; font-size: .83rem; font-weight: 500; color: var(--text2);
  border-bottom: 2px solid transparent; cursor: pointer; transition: all .16s; white-space: nowrap;
}
.tab-link.active, .tab-link:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Page header ─────────────────────────────────────────────────────────── */
.page-head { padding: 2rem 0 1.5rem; }
.page-head h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: .35rem; }
.page-head p { color: var(--text2); font-size: .84rem; }
.breadcrumb { display: flex; gap: .5rem; align-items: center; font-size: .75rem; color: var(--text3); margin-bottom: .6rem; }
.breadcrumb a { color: var(--text3); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--border); }

/* ── Toast ───────────────────────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 1.75rem; left: 50%;
  transform: translateX(-50%) translateY(70px);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 11px; padding: 11px 18px;
  font-size: .81rem; font-weight: 500; z-index: 9999;
  transition: transform .24s ease, opacity .24s;
  opacity: 0; display: flex; align-items: center; gap: 7px;
  box-shadow: 0 8px 22px rgba(0,0,0,.35); pointer-events: none; white-space: nowrap;
}
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
#toast.success { border-color: rgba(16,185,129,.45); }
#toast.error   { border-color: rgba(239,68,68,.45); }
#toast.info    { border-color: rgba(0,212,255,.35); }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.68);
  backdrop-filter: blur(7px); z-index: 400;
  opacity: 0; pointer-events: none; transition: opacity .26s;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 20px; width: 100%; max-width: 740px; max-height: 92vh;
  overflow: hidden; transform: scale(.95) translateY(14px);
  opacity: 0; transition: all .28s cubic-bezier(.34,1.56,.64,1);
  display: flex; flex-direction: column;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); opacity: 1; }
.modal-sm { max-width: 440px; }
.modal-header {
  padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.modal-header h2 { font-size: .95rem; font-weight: 700; }
.modal-close {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; width: 30px; height: 30px; color: var(--text2);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .16s; font-size: .85rem;
}
.modal-close:hover { color: var(--red); border-color: var(--red); }
.modal-body { padding: 1.4rem; overflow-y: auto; flex: 1; }
.modal-footer { padding: 1rem 1.4rem; border-top: 1px solid var(--border); display: flex; gap: .6rem; justify-content: flex-end; flex-shrink: 0; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer {
  position: relative; z-index: 1;
  background: var(--bg2); border-top: 1px solid var(--border); margin-top: 3rem;
}
.footer-main {
  max-width: 1200px; margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2.5rem;
}
.footer-logo { font-family: 'Instrument Serif', serif; font-style: italic; font-size: 1.5rem; background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; display: block; margin-bottom: .75rem; }
.footer-desc { font-size: .8rem; color: var(--text2); line-height: 1.75; margin-bottom: 1.1rem; }
.footer-hotline { display: flex; flex-direction: column; gap: .55rem; }
.footer-hotline-item { display: flex; align-items: center; gap: 8px; font-size: .78rem; }
.footer-hotline-icon { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: .85rem; flex-shrink: 0; }
.footer-hotline-label { color: var(--text3); font-size: .7rem; }
.footer-hotline-val { color: var(--text); font-weight: 600; }
.footer-col h4 { font-size: .75rem; font-weight: 700; color: var(--text); letter-spacing: .5px; text-transform: uppercase; margin-bottom: 1rem; }
.footer-links { display: flex; flex-direction: column; gap: .6rem; }
.footer-links a { font-size: .78rem; color: var(--text2); display: flex; align-items: center; gap: 6px; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); }
.footer-bottom-inner { max-width: 1200px; margin: 0 auto; padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-copy { font-size: .73rem; color: var(--text3); }
.footer-bottom-links { display: flex; gap: 1.25rem; }
.footer-bottom-links a { font-size: .72rem; color: var(--text3); }
.footer-bottom-links a:hover { color: var(--accent); }

/* ── Admin Sidebar ───────────────────────────────────────────────────────── */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 60px); position: relative; z-index: 1; }
.admin-sidebar { background: var(--bg2); border-right: 1px solid var(--border); padding: 1.5rem 0; position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; }
.admin-sidebar h3 { font-size: .65rem; color: var(--text3); letter-spacing: .8px; text-transform: uppercase; padding: 0 1.25rem; margin: 1.25rem 0 .5rem; }
.admin-sidebar a { display: flex; align-items: center; gap: 9px; padding: 9px 1.25rem; color: var(--text2); font-size: .83rem; font-weight: 500; transition: background .15s, color .15s; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(0,212,255,.07); color: var(--accent); }
.admin-sidebar a .si { font-size: .9rem; width: 18px; flex-shrink: 0; }
.admin-content { padding: 2rem; overflow: hidden; }
.admin-stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.astat { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 1.1rem 1.25rem; }
.astat-icon { font-size: 1.5rem; margin-bottom: .6rem; }
.astat-num { font-family: 'DM Mono', monospace; font-size: 1.6rem; font-weight: 500; line-height: 1.1; }
.astat-label { font-size: .72rem; color: var(--text2); margin-top: 3px; }

/* ── Utilities ───────────────────────────────────────────────────────────── */
.text-accent { color: var(--accent); }
.text-green  { color: #34d399; }
.text-red    { color: #f87171; }
.text-muted  { color: var(--text2); }
.text-dim    { color: var(--text3); }
.fw-600 { font-weight: 600; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.flex { display: flex; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,.5); } 70% { box-shadow: 0 0 0 7px rgba(16,185,129,0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); } }
.fade-up { animation: fadeUp .42s ease both; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .footer-main { grid-template-columns: 1fr 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
}
@media (max-width: 640px) {
  .footer-main { grid-template-columns: 1fr; padding: 2rem 1rem 1.5rem; }
  .footer-bottom-inner { flex-direction: column; align-items: center; text-align: center; }
  .container { padding: 0 1rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
