/* ==========================================================================
   Camdonghang2 - Hệ thống Web & Quản lý Tài khoản Bản quyền
   Phong cách: Dark Mode Slate + Orange Accent (#f59e0b) + Neon Green (#10b981)
   ========================================================================== */

:root {
  --bg-main: #0b1120;
  --bg-card: #162032;
  --bg-card-hover: #1e293b;
  --bg-input: #0f172a;
  --border-color: #334155;
  --border-focus: #f59e0b;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --primary-orange: #f59e0b;
  --primary-orange-hover: #d97706;
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --success-green: #10b981;
  --danger-red: #ef4444;
  --warning-yellow: #eab308;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(245, 158, 11, 0.25);
  --shadow-blue-glow: 0 0 20px rgba(59, 130, 246, 0.25);
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary-orange);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-orange-hover);
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.navbar {
  padding: 18px 0;
  border-bottom: 1px solid var(--border-color);
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-badge {
  background: linear-gradient(135deg, var(--primary-orange), #ea580c);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.logo-text span {
  color: var(--primary-orange);
}

.logo-version {
  background: rgba(245, 158, 11, 0.15);
  color: var(--primary-orange);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-left: 6px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius-md);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-orange), #ea580c);
  color: #fff;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fbbf24, var(--primary-orange));
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
  color: #fff;
}

.btn-blue {
  background: linear-gradient(135deg, var(--accent-blue), #1d4ed8);
  color: #fff;
}

.btn-blue:hover {
  background: linear-gradient(135deg, #60a5fa, var(--accent-blue));
  color: #fff;
}

.btn-success {
  background: linear-gradient(135deg, var(--success-green), #059669);
  color: #fff;
}

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

.btn-outline:hover {
  border-color: var(--primary-orange);
  color: var(--primary-orange);
  background: rgba(245, 158, 11, 0.05);
}

.btn-block {
  width: 100%;
}

.btn-google {
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.btn-google:hover {
  background: #f9fafb;
  color: #111827;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* ==========================================================================
   AUTH BOX / CARDS (REGISTER & LOGIN)
   ========================================================================== */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  padding: 40px 20px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-card);
  position: relative;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 40px;
  right: 40px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary-orange), transparent);
  border-radius: 2px;
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.12);
  color: var(--primary-orange);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.auth-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
}

.auth-desc {
  font-size: 14px;
  color: var(--text-muted);
}

/* Form controls */
.form-group {
  margin-bottom: 18px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-label span.req {
  color: var(--primary-orange);
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  color: var(--text-dim);
  pointer-events: none;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.input-with-icon .form-control {
  padding-left: 42px;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.btn-toggle-pass {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  font-size: 15px;
}

.btn-toggle-pass:hover {
  color: var(--text-main);
}

.form-footer-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-top: -6px;
  margin-bottom: 20px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 22px 0;
  color: var(--text-dim);
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.divider span {
  padding: 0 12px;
}

/* Alert notifications */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 20px;
  display: none;
  align-items: center;
  gap: 10px;
}

.alert.show {
  display: flex;
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.alert-info {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}

/* ==========================================================================
   DASHBOARD & CARDS
   ========================================================================== */
.dashboard-wrapper {
  padding: 30px 0 60px;
  flex: 1;
}

.welcome-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.welcome-title h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
}

.welcome-title p {
  color: var(--text-muted);
  font-size: 14px;
}

.grid-dashboard {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 24px;
}

@media (max-width: 860px) {
  .grid-dashboard {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-card);
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* License Badge */
.license-box {
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

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

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
}

.status-badge.trial {
  background: rgba(245, 158, 11, 0.15);
  color: var(--primary-orange);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.status-badge.vip {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success-green);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-badge.expired {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger-red);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.license-key-display {
  display: flex;
  align-items: center;
  background: var(--bg-main);
  border: 1px dashed var(--primary-orange);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 10px;
}

.license-key-code {
  font-family: monospace;
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-orange);
  letter-spacing: 1.5px;
  flex: 1;
}

/* Step-by-step app connection */
.step-item {
  display: flex;
  gap: 16px;
  margin-bottom: 18px;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.step-content h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.step-content p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ==========================================================================
   ADMIN TABLE & STATS
   ========================================================================== */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.stat-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
}

.stat-val.highlight {
  color: var(--primary-orange);
}

.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.custom-table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-weight: 600;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.custom-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  vertical-align: middle;
}

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

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.user-shop-name {
  font-weight: 700;
  color: var(--text-main);
}

.user-email-sub {
  font-size: 12px;
  color: var(--text-dim);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 25px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: auto;
}

.footer strong {
  color: var(--text-main);
}

/* Responsive utilities */
@media (max-width: 640px) {
  .auth-card {
    padding: 24px 18px;
  }
  .navbar .container {
    flex-direction: column;
    gap: 12px;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}
