/* ============================================================
   DOTRONGHOA.SHOP — Global Design System
   Theme: Green & Dark Professional
   ============================================================ */

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

/* ── CSS Variables ─────────────────────────────────────── */
:root {
  --bg-base:       #0d1117;
  --bg-card:       #161b27;
  --bg-card-hover: #1e2535;
  --bg-sidebar:    #111827;
  --bg-input:      #1e2535;

  --green-primary: #00d084;
  --green-dark:    #00a567;
  --green-glow:    rgba(0, 208, 132, 0.25);
  --green-subtle:  rgba(0, 208, 132, 0.08);

  --text-primary:  #e8eaf0;
  --text-secondary:#8892a0;
  --text-muted:    #4a5568;

  --border:        rgba(0, 208, 132, 0.18);
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-input:  rgba(255, 255, 255, 0.12);

  --sidebar-width: 260px;
  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     16px;
  --radius-xl:     20px;

  --shadow-card:   0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-green:  0 0 20px rgba(0, 208, 132, 0.2);
  --shadow-glow:   0 0 40px rgba(0, 208, 132, 0.12);

  --transition:    all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
  /* Đảm bảo nền đen toàn trang */
  background-color: #0d1117 !important;
}

/* Content là flex column để footer nằm dưới */
.content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
}

/* Override nền sáng từ các trang cũ */
.main, .container.page-container, div[class*="section"], .section {
  background: transparent !important;
  color: var(--text-primary) !important;
}

/* Override bảng sáng */
table th {
  background-color: rgba(0,208,132,0.08) !important;
  color: var(--green-primary) !important;
  border-color: var(--border) !important;
}
table td {
  border-color: var(--border-subtle) !important;
  color: var(--text-secondary) !important;
}
table tr:hover td {
  background: var(--green-subtle) !important;
}

/* Override input sáng */
input[type="text"], input[type="password"],
input[type="email"], input[type="number"],
textarea, select {
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-input) !important;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--green-primary) !important;
  outline: none !important;
}

/* Override nền trắng của .bank-card, .section, .note-small */
.bank-card {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}
.bank-card p, .bank-card strong {
  color: var(--text-primary) !important;
}
.note-small {
  color: var(--text-secondary) !important;
}
.note-highlight {
  color: #f87171 !important;
}

a {
  color: var(--green-primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover { color: #fff; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--green-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-primary); }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo img {
  width: 100%;
  max-width: 200px;
  height: auto;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--green-primary), var(--green-dark));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: var(--shadow-green);
}

.sidebar-logo-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.sidebar-logo-sub {
  font-size: 11px;
  color: var(--green-primary);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 8px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin: 2px 0;
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  width: 100%;
  background: none;
  text-align: left;
}

.nav-link:hover {
  background: var(--green-subtle);
  color: var(--green-primary);
  border-color: var(--border);
}

.nav-link.active {
  background: var(--green-subtle);
  color: var(--green-primary);
  border-color: var(--border);
}

.nav-link .nav-icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-link .nav-arrow {
  margin-left: auto;
  font-size: 11px;
  transition: transform 0.25s ease;
  color: var(--text-muted);
}

.nav-link .nav-arrow.rotated {
  transform: rotate(180deg);
}

.nav-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 10px 8px;
}

/* Submenu */
.submenu {
  display: none;
  padding-left: 16px;
  margin: 2px 0;
}

.submenu.open { display: block; }

.submenu .nav-link {
  font-size: 13px;
  padding: 8px 12px;
  color: var(--text-muted);
}

.submenu .nav-link:hover {
  color: var(--green-primary);
  background: var(--green-subtle);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border-subtle);
}

.sidebar-user-card {
  background: var(--green-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
}

.sidebar-user-card .user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.sidebar-user-card .user-balance {
  font-size: 16px;
  font-weight: 700;
  color: var(--green-primary);
}

.sidebar-user-card .user-balance-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Content Area ───────────────────────────────────────── */
.content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
}

.topbar-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--green-subtle);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-secondary);
}

.topbar-badge .badge-value {
  font-weight: 700;
  color: var(--green-primary);
}

.topbar-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-auth-links {
  display: flex;
  gap: 10px;
}

.btn-outline-sm {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  transition: var(--transition);
}

.btn-outline-sm:hover {
  border-color: var(--green-primary);
  color: var(--green-primary);
  background: var(--green-subtle);
}

.btn-green-sm {
  padding: 6px 16px;
  border: none;
  border-radius: 50px;
  font-size: 12.5px;
  font-weight: 600;
  color: #000;
  background: var(--green-primary);
  transition: var(--transition);
}

.btn-green-sm:hover {
  background: var(--green-dark);
  color: #000;
  box-shadow: var(--shadow-green);
}

/* ── Page Wrapper ───────────────────────────────────────── */
.page-wrapper {
  padding: 28px 32px;
  flex: 1;
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.card-sm {
  padding: 16px;
  border-radius: var(--radius-md);
}

/* Product Cards */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--green-primary), transparent);
  opacity: 0;
  transition: var(--transition);
}

.product-card:hover {
  border-color: var(--border);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.product-card:hover::before {
  opacity: 1;
}

.product-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--bg-base);
}

.product-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.product-card-price {
  font-size: 17px;
  font-weight: 700;
  color: var(--green-primary);
}

.product-card-price span {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

.product-card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--green-primary), var(--green-dark));
  color: #000;
  box-shadow: 0 4px 15px rgba(0, 208, 132, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 208, 132, 0.45);
  color: #000;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--green-primary);
  color: var(--green-primary);
  background: var(--green-subtle);
}

.btn-block { width: 100%; }

/* ── Form Elements ───────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

select.form-input {
  cursor: pointer;
  appearance: none;
}

/* ── Section Headers ─────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.section-header-icon {
  width: 38px;
  height: 38px;
  background: var(--green-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.section-header h2, .section-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.section-divider {
  height: 1px;
  background: linear-gradient(90deg, var(--green-primary), transparent);
  margin: 32px 0;
  opacity: 0.3;
}

/* ── Tables ──────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

table.dt {
  width: 100%;
  border-collapse: collapse;
}

table.dt thead {
  background: rgba(0, 208, 132, 0.08);
}

table.dt th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--green-primary);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

table.dt td {
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

table.dt tbody tr:hover td {
  background: var(--green-subtle);
  color: var(--text-primary);
}

table.dt tbody tr:last-child td {
  border-bottom: none;
}

/* ── Badges / Tags ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-green  { background: rgba(0,208,132,0.15); color: var(--green-primary); border: 1px solid rgba(0,208,132,0.3); }
.badge-red    { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.badge-yellow { background: rgba(251,191,36,0.15); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.badge-blue   { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert-error   { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); color: #fca5a5; }
.alert-success { background: rgba(0,208,132,0.1); border: 1px solid var(--border); color: var(--green-primary); }
.alert-warning { background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.25); color: #fbbf24; }

/* ── Grid Layouts ────────────────────────────────────────── */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

/* ── Stats / Info Boxes ─────────────────────────────────── */
.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.stat-box:hover {
  border-color: var(--border);
  background: var(--bg-card-hover);
}

.stat-icon {
  width: 48px;
  height: 48px;
  background: var(--green-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-info {}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.3px;
}
.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .content {
    margin-left: 0;
  }

  .page-wrapper {
    padding: 20px 16px;
  }

  .grid-3, .grid-4 {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }
}

/* ── Animations ─────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,208,132,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(0,208,132,0); }
}

.animate-fade-up {
  animation: fadeInUp 0.4s ease both;
}

/* ── Glassmorphism helpers ──────────────────────────────── */
.glass {
  background: rgba(22, 27, 39, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
}

/* ── Utility ────────────────────────────────────────────── */
.text-green  { color: var(--green-primary); }
.text-muted  { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-danger { color: #f87171; }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.text-center { text-align: center; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
