/* =============================================
   BLACK SMS â€” App CSS  (replaces tailwind.min.css)
   Brand: #141414 bg Â· #ED2128 accent Â· #fff text
   ============================================= */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f5;
  color: #1a1a1a;
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input,
textarea,
select {
  font-family: inherit;
}

/* ---------- CSS Variables ---------- */
:root {
  --brand: #ED2128;
  --brand-dark: #c0171d;
  --brand-light: #fff1f1;
  --dark: #141414;
  --dark2: #1e1e1e;
  --dark3: #2a2a2a;
  --gray: #6b7280;
  --gray-light: #f5f5f5;
  --border: #e5e7eb;
  --white: #ffffff;
  --success: #16a34a;
  --error: #dc2626;
  --warn: #d97706;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0, 0, 0, .08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, .12);
  --transition: .2s ease;
}

/* ---------- Layout Utilities ---------- */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.flex-1 {
  flex: 1;
}

.gap-4 {
  gap: 16px;
}

.gap-6 {
  gap: 24px;
}

.grid {
  display: grid;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.w-full {
  width: 100%;
}

.min-h-screen {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ---------- Spacing Utilities ---------- */
.mt-2 {
  margin-top: 8px
}

.mt-4 {
  margin-top: 16px
}

.mt-6 {
  margin-top: 24px
}

.mt-8 {
  margin-top: 32px
}

.mb-2 {
  margin-bottom: 8px
}

.mb-4 {
  margin-bottom: 16px
}

.mb-6 {
  margin-bottom: 24px
}

.mr-2 {
  margin-right: 8px
}

.mr-3 {
  margin-right: 12px
}

.p-4 {
  padding: 16px
}

.p-5 {
  padding: 20px
}

.p-6 {
  padding: 24px
}

.px-4 {
  padding-left: 16px;
  padding-right: 16px
}

.py-2 {
  padding-top: 8px;
  padding-bottom: 8px
}

.py-3 {
  padding-top: 12px;
  padding-bottom: 12px
}

.space-y-3>*+* {
  margin-top: 12px;
}

.space-y-4>*+* {
  margin-top: 16px;
}

/* ---------- Typography ---------- */
.text-xs {
  font-size: .75rem;
}

.text-sm {
  font-size: .875rem;
}

.text-base {
  font-size: 1rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-2xl {
  font-size: 1.5rem;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.text-center {
  text-align: center;
}

.text-white {
  color: #fff;
}

.text-gray {
  color: var(--gray);
}

.text-brand {
  color: var(--brand);
}

.text-success {
  color: var(--success);
}

.text-error {
  color: var(--error);
}

.uppercase {
  text-transform: uppercase;
}

.tracking-wide {
  letter-spacing: .05em;
}

.break-all {
  word-break: break-all;
}

.font-mono {
  font-family: 'Courier New', monospace;
}

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-body {
  padding: 24px;
}

.card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header i {
  color: var(--brand);
}

/* ---------- Stat Cards ---------- */
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-icon.red {
  background: #fff1f1;
  color: var(--brand);
}

.stat-icon.green {
  background: #f0fdf4;
  color: var(--success);
}

.stat-icon.blue {
  background: #eff6ff;
  color: #2563eb;
}

.stat-icon.amber {
  background: #fffbeb;
  color: var(--warn);
}

.stat-label {
  font-size: .8rem;
  color: var(--gray);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111;
}

/* ---------- Info Field ---------- */
.info-field {
  background: var(--gray-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}

.info-field .label {
  font-size: .75rem;
  color: var(--gray);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-field .value {
  font-size: 1rem;
  font-weight: 600;
  color: #111;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-brand {
  background: var(--brand);
  color: #fff;
}

.btn-brand:hover {
  background: var(--brand-dark);
  box-shadow: 0 4px 14px rgba(237, 33, 40, .35);
}

.btn-outline {
  background: transparent;
  color: var(--brand);
  border: 2px solid var(--brand);
}

.btn-outline:hover {
  background: var(--brand);
  color: #fff;
}

.btn-gray {
  background: #e5e7eb;
  color: #374151;
}

.btn-gray:hover {
  background: #d1d5db;
}

.btn-dark {
  background: var(--dark);
  color: #fff;
}

.btn-dark:hover {
  background: var(--dark2);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  background: #15803d;
}

.btn-sm {
  padding: 8px 14px;
  font-size: .8rem;
}

.btn-full {
  width: 100%;
}

/* ---------- Quick Action Links ---------- */
.action-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 8px;
  font-weight: 500;
  font-size: .9rem;
  transition: all var(--transition);
  background: var(--gray-light);
  color: #111;
  text-decoration: none;
}

.action-link:hover {
  background: var(--brand-light);
  color: var(--brand);
  transform: translateX(4px);
}

.action-link i {
  width: 20px;
  text-align: center;
  color: var(--brand);
}

.action-link .chevron {
  margin-left: auto;
  font-size: .75rem;
  color: var(--gray);
}

/* ---------- Forms ---------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: .875rem;
  font-weight: 500;
  color: #374151;
}

.form-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: #fff;
  color: #111;
}

.form-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(237, 33, 40, .12);
}

.form-input::placeholder {
  color: #9ca3af;
}

.input-wrap {
  position: relative;
}

.input-wrap .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.input-wrap .input-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  cursor: pointer;
}

.form-input-no-icon {
  padding-left: 16px;
}

/* ---------- Alerts ---------- */
.alert {
  padding: 14px 16px;
  border-radius: 8px;
  font-size: .9rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.alert-error {
  background: #fff1f1;
  color: var(--error);
  border: 1px solid #fecaca;
}

.alert-info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.alert-warn {
  background: #fffbeb;
  color: var(--warn);
  border: 1px solid #fde68a;
}

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 540px;
}

thead tr {
  background: #f9f9f9;
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: .75rem;
  font-weight: 600;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  font-size: .875rem;
  color: #111;
  border-top: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr:hover {
  background: #fafafa;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}

.badge-green {
  background: #f0fdf4;
  color: #15803d;
}

.badge-blue {
  background: #eff6ff;
  color: #1d4ed8;
}

.badge-red {
  background: #fff1f1;
  color: var(--brand);
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 24px;
}

.page-btn {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  background: #e5e7eb;
  color: #374151;
  border: none;
}

.page-btn:hover {
  background: #d1d5db;
}

.page-btn.active {
  background: var(--brand);
  color: #fff;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  font-size: .9rem;
  opacity: 0;
  transition: opacity .3s;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show {
  opacity: 1;
}

/* ---------- Code Block ---------- */
.code-block {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: .82rem;
  line-height: 1.6;
}

.code-block pre {
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---------- Main Layout ---------- */
.main-content {
  padding-top: 68px;
  /* header height */
  padding-bottom: 60px;
  /* footer height */
  min-height: 100vh;
}

.page-content {
  padding: 24px 16px;
  max-width: 1100px;
  margin: 0 auto;
}

/* ---------- App Header (vipconn) ---------- */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--dark);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-logo img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--brand);
}

.app-logo span {
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  letter-spacing: .5px;
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.balance-chip {
  background: rgba(237, 33, 40, .15);
  border: 1px solid rgba(237, 33, 40, .3);
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.balance-chip i {
  color: var(--brand);
}

.menu-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #fff;
  font-size: 1.2rem;
  transition: background var(--transition);
}

.menu-btn:hover {
  background: rgba(255, 255, 255, .1);
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  background: var(--dark);
  transform: translateX(100%);
  transition: transform .3s ease;
  z-index: 300;
  overflow-y: auto;
  padding: 0 0 20px;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  position: sticky;
  top: 0;
  background: var(--dark);
}

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

.sidebar-logo img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--brand);
}

.sidebar-logo span {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}

.close-btn {
  color: #aaa;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 6px;
  transition: color var(--transition);
}

.close-btn:hover {
  color: #fff;
}

.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-user .name {
  color: #fff;
  font-weight: 600;
  font-size: .95rem;
}

.sidebar-user .bal {
  color: var(--brand);
  font-size: .82rem;
  margin-top: 2px;
}

.sidebar-nav {
  padding: 12px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #ccc;
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  margin-bottom: 2px;
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: .95rem;
}

.nav-item:hover {
  background: rgba(255, 255, 255, .07);
  color: #fff;
}

.nav-item.active {
  background: rgba(237, 33, 40, .18);
  color: var(--brand);
}

.nav-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, .08);
  margin: 10px 0;
}

.nav-item.danger {
  color: #ff6b6b;
}

.nav-item.danger:hover {
  background: rgba(255, 107, 107, .1);
  color: #ff6b6b;
}

.sidebar-tg {
  margin: 12px 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0, 136, 204, .15);
  border: 1px solid rgba(0, 136, 204, .3);
  border-radius: 8px;
  color: #5bc8f5;
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition);
}

.sidebar-tg:hover {
  background: rgba(0, 136, 204, .25);
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 250;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ---------- App Footer (vipconn) ---------- */
.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--dark);
  border-top: 1px solid rgba(255, 255, 255, .06);
  padding: 10px 16px;
  text-align: center;
  font-size: .78rem;
  color: #666;
}

/* ---------- Login Page ---------- */
.auth-page {
  min-height: 100vh;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .12);
  overflow: hidden;
}

.auth-top {
  background: var(--dark);
  padding: 32px 24px 24px;
  text-align: center;
}

.auth-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--brand);
  margin: 0 auto 16px;
}

.auth-title {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
}

.auth-sub {
  color: #999;
  font-size: .85rem;
  margin-top: 4px;
}

.auth-body {
  padding: 28px 24px;
}

.auth-footer {
  padding: 14px 24px;
  background: #f9f9f9;
  text-align: center;
  font-size: .8rem;
  color: var(--gray);
  border-top: 1px solid var(--border);
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .card-body {
    padding: 16px;
  }

  .page-content {
    padding: 16px 12px;
  }

  .hide-mobile {
    display: none;
  }
}

@media (min-width: 641px) and (max-width: 768px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 769px) {
  .grid-2-lg {
    grid-template-columns: repeat(2, 1fr);
  }
}