/* SUBMAX DESIGN SYSTEM — TYPOGRAPHY, SPACING & DARK/LIGHT THEMES */
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: #09090b;
  color: #f4f4f5;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.submax-tab-panel {
  display: block;
}

.submax-tab-panel.hidden {
  display: none !important;
}

/* Nút Sidebar đang active */
.sidebar-nav-btn.active {
  background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px -2px rgba(239, 68, 68, 0.4);
}

.sidebar-platform-btn.active-platform {
  background-color: rgba(239, 68, 68, 0.14);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}

.sidebar-cat-item.active-cat {
  color: #ffffff;
  background-color: rgba(239, 68, 68, 0.25);
  font-weight: 700;
}

/* Server Card & Badges (Đảm bảo độ tương phản chuẩn trên cả Dark & Light) */
.price-badge {
  background-color: #dc2626;
  color: #ffffff !important;
}
.cancel-badge {
  background-color: #fbbf24;
  color: #18181b !important;
}
.refill-badge {
  background-color: #059669;
  color: #ffffff !important;
}
.speed-badge {
  background-color: #27272a;
  color: #e4e4e7;
  border: 1px solid #3f3f46;
}

/* Hiệu ứng hover card dịch vụ trên trang chủ */
.landing-card {
  background-color: #111114;
  border: 1px solid #27272a;
  transition: all 0.25s ease;
}
.landing-card:hover {
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 10px 30px -10px rgba(239, 68, 68, 0.2);
  transform: translateY(-2px);
}

.red-glow-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 6px 20px -4px rgba(239, 68, 68, 0.45);
  color: #ffffff !important;
}
.red-glow-btn:hover {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
}

/* Hiệu ứng trượt cho Giao Dịch Live thời gian thực */
@keyframes liveSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-14px) scale(0.98);
    border-color: rgba(239, 68, 68, 0.7);
    background-color: rgba(239, 68, 68, 0.08);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    border-color: rgba(39, 39, 42, 0.8);
    background-color: #18181b;
  }
}

.live-item-enter {
  animation: liveSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #09090b;
}
::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

/* ============================================================
   CHUẨN HÓA CĂN GIỮA TOÀN BỘ FORM SELECT, INPUT, BUTTON TRÊN WEB
   ============================================================ */
select,
.form-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a1a1aa'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2' d='M19 9l-7 7-7-7'%3e%3c/path%3e%3c/svg%3e") !important;
  background-position: right 14px center !important;
  background-repeat: no-repeat !important;
  background-size: 16px 16px !important;
  padding-left: 14px !important;
  padding-right: 44px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  height: 44px !important;
  line-height: 42px !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
  display: block !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  cursor: pointer;
}

select::-ms-expand {
  display: none !important;
}

select option {
  padding: 10px 14px;
  background-color: #18181b;
  color: #f4f4f5;
  font-size: 13px;
}

html[data-theme="light"] select option {
  background-color: #ffffff;
  color: #18181b;
}

/* Chuẩn hóa Input text/number/search */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="search"] {
  height: 44px !important;
  line-height: 42px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-left: 14px !important;
  padding-right: 14px !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
}

/* Các select nhỏ gọn (như filter table h-9) */
select.h-9 {
  height: 38px !important;
  line-height: 36px !important;
  background-size: 14px 14px !important;
  background-position: right 10px center !important;
  padding-right: 32px !important;
  padding-left: 12px !important;
}

/* Đảm bảo toàn bộ label luôn chuẩn */
label {
  display: inline-block;
  vertical-align: middle;
}

/* Các nút hành động thông thường thì căn giữa */
.btn,
.red-glow-btn,
button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   BẢNG & BADGE — CHỐNG VỠ DÒNG, CĂN GIỮA ĐẸP MẮT
   ============================================================ */
.table td, 
.table th {
  vertical-align: middle !important;
}

#pricingTable td, #pricingTable th {
  padding-left: 0.55rem !important;
  padding-right: 0.55rem !important;
  padding-top: 0.65rem !important;
  padding-bottom: 0.65rem !important;
}

#ordersTable td, #ordersTable th {
  padding-left: 0.3rem !important;
  padding-right: 0.3rem !important;
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

.table td .badge,
.table th .badge,
.badge {
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: normal !important;
}

/* Badge trạng thái máy chủ trong bảng giá (Chống vỡ 2 dòng tuyệt đối) */
.service-status-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  padding: 4px 10px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  border-radius: 9999px !important;
  min-width: 78px !important;
  text-align: center !important;
  line-height: 1.2 !important;
}

.service-status-badge.active {
  background-color: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
}

.service-status-badge.closed {
  background-color: rgba(239, 68, 68, 0.2) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
}

html[data-theme="light"] .service-status-badge.active {
  background-color: #d1fae5 !important;
  color: #065f46 !important;
  border-color: #a7f3d0 !important;
}

html[data-theme="light"] .service-status-badge.closed {
  background-color: #fee2e2 !important;
  color: #991b1b !important;
  border-color: #fca5a5 !important;
}

html[data-theme="light"] .order-status-badge.bg-amber-500\/20 {
  background-color: #fef3c7 !important;
  color: #b45309 !important;
  border-color: #fde68a !important;
}

html[data-theme="light"] .order-status-badge.bg-blue-500\/20 {
  background-color: #dbeafe !important;
  color: #1d4ed8 !important;
  border-color: #bfdbfe !important;
}

html[data-theme="light"] .order-status-badge.bg-emerald-500\/20 {
  background-color: #d1fae5 !important;
  color: #065f46 !important;
  border-color: #a7f3d0 !important;
}

html[data-theme="light"] .order-status-badge.bg-red-500\/20 {
  background-color: #fee2e2 !important;
  color: #b91c1c !important;
  border-color: #fca5a5 !important;
}

/* Nút Mua trong bảng giá (Chống vỡ dòng icon + chữ) */
.service-buy-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  padding: 5px 12px !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  border-radius: 8px !important;
  min-width: 66px !important;
  height: 28px !important;
  line-height: 1 !important;
  gap: 4px !important;
  cursor: pointer;
}

/* Badge trạng thái đơn hàng trong danh sách đơn */
.order-status-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  padding: 4px 10px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  border-radius: 9999px !important;
  min-width: 86px !important;
  text-align: center !important;
  line-height: 1.2 !important;
}

/* ============================================================
   CHUẨN HÓA SIDEBAR MENU — CĂN THẲNG HÀNG 100% CÁC MỤC VÀ BULLET
   ============================================================ */
.sidebar-nav-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
  width: 100% !important;
}

.sidebar-nav-btn .nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-nav-btn .nav-text {
  flex: 1;
  text-align: left;
  white-space: nowrap;
}

.sidebar-platform-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  text-align: left !important;
  width: 100% !important;
}

.sidebar-platform-btn .platform-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-platform-btn .platform-name {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Phân nhánh cấp 2 (Subcategories) có đường kẻ phân nhánh thẳng tắp */
.sidebar-subcats {
  margin-left: 14px !important;
  padding-left: 12px !important;
  border-left: 2px solid rgba(255, 255, 255, 0.08);
  margin-top: 2px;
  margin-bottom: 6px;
}

html[data-theme="light"] .sidebar-subcats {
  border-left-color: rgba(0, 0, 0, 0.1) !important;
}

/* Từng mục dịch vụ con: Căn thẳng tắp lề trái, bullet thẳng hàng dọc tuyệt đối */
.sidebar-cat-item {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
  width: 100% !important;
  padding: 6px 8px !important;
  gap: 8px !important;
  font-size: 11.5px !important;
  line-height: 1.3 !important;
  border-radius: 8px !important;
}

.sidebar-cat-item .cat-bullet {
  display: inline-block;
  width: 5px;
  height: 5px;
  min-width: 5px;
  border-radius: 9999px;
  background-color: #52525b;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.sidebar-cat-item:hover .cat-bullet,
.sidebar-cat-item.active-cat .cat-bullet {
  background-color: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.9);
  transform: scale(1.3);
}

.sidebar-cat-item .cat-name {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   LIGHT THEME OVERRIDES (Mặc định là Dark, chuyển Light qua nút)
   ============================================================ */
html[data-theme="light"] body {
  background-color: #f4f5f7 !important;
  color: #09090b !important;
}

html[data-theme="light"] .bg-\[\#09090b\],
html[data-theme="light"] .bg-\[\#09090b\]\/90,
html[data-theme="light"] .bg-\[\#0c0c0e\],
html[data-theme="light"] .bg-\[\#070709\] {
  background-color: #f4f4f5 !important;
}

html[data-theme="light"] .bg-\[\#0e0e11\],
html[data-theme="light"] .bg-\[\#0e0e11\]\/95,
html[data-theme="light"] .bg-\[\#111114\],
html[data-theme="light"] .bg-\[\#141418\],
html[data-theme="light"] .landing-card {
  background-color: #ffffff !important;
  border-color: #e4e4e7 !important;
}

html[data-theme="light"] .bg-\[\#18181b\],
html[data-theme="light"] .bg-\[\#0d111a\],
html[data-theme="light"] .bg-zinc-900,
html[data-theme="light"] .bg-zinc-800 {
  background-color: #f4f4f5 !important;
  border-color: #e4e4e7 !important;
}

html[data-theme="light"] .bg-\[\#18141c\] {
  background-color: #fffbeb !important;
  border-color: #fcd34d !important;
}

html[data-theme="light"] .bg-\[\#1f1215\] {
  background-color: #fef2f2 !important;
  border-color: #fca5a5 !important;
}

html[data-theme="light"] .border-zinc-800,
html[data-theme="light"] .border-zinc-800\/80,
html[data-theme="light"] .border-zinc-900,
html[data-theme="light"] .border-zinc-700,
html[data-theme="light"] .border-zinc-700\/80 {
  border-color: #e4e4e7 !important;
}

html[data-theme="light"] .text-white,
html[data-theme="light"] .text-zinc-100,
html[data-theme="light"] .text-zinc-200 {
  color: #18181b !important;
}

html[data-theme="light"] .text-zinc-300,
html[data-theme="light"] .text-zinc-400 {
  color: #52525b !important;
}

html[data-theme="light"] .text-zinc-500 {
  color: #71717a !important;
}

/* Badges giữ nguyên độ tương phản rõ nét trên Light Mode */
html[data-theme="light"] .speed-badge {
  background-color: #e4e4e7 !important;
  color: #27272a !important;
  border-color: #d4d4d8 !important;
}

html[data-theme="light"] .red-glow-btn,
html[data-theme="light"] .red-glow-btn *,
html[data-theme="light"] .bg-red-600,
html[data-theme="light"] .bg-red-600 *,
html[data-theme="light"] .bg-emerald-600,
html[data-theme="light"] .bg-blue-600,
html[data-theme="light"] .sidebar-nav-btn.active,
html[data-theme="light"] .sidebar-nav-btn.active *,
html[data-theme="light"] .price-badge,
html[data-theme="light"] .refill-badge {
  color: #ffffff !important;
}

html[data-theme="light"] .text-red-500 {
  color: #dc2626 !important;
}

html[data-theme="light"] .text-red-400 {
  color: #ef4444 !important;
}

html[data-theme="light"] .text-amber-400 {
  color: #d97706 !important;
}

html[data-theme="light"] .sidebar-platform-btn.active-platform {
  background-color: #fef2f2 !important;
  color: #dc2626 !important;
  border-color: #fecaca !important;
}

html[data-theme="light"] .sidebar-cat-item {
  color: #3f3f46 !important;
}

html[data-theme="light"] .sidebar-cat-item:hover {
  background-color: #f4f4f5 !important;
  color: #09090b !important;
}

html[data-theme="light"] .sidebar-cat-item.active-cat {
  background-color: #fee2e2 !important;
  color: #b91c1c !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .sidebar-cat-item .cat-bullet {
  background-color: #a1a1aa !important;
}

html[data-theme="light"] .sidebar-cat-item:hover .cat-bullet,
html[data-theme="light"] .sidebar-cat-item.active-cat .cat-bullet {
  background-color: #dc2626 !important;
}

html[data-theme="light"] .table,
html[data-theme="light"] .table-zebra {
  color: #18181b !important;
}

html[data-theme="light"] .table tbody tr,
html[data-theme="light"] .table-zebra tbody tr {
  background-color: #ffffff !important;
  color: #18181b !important;
  border-color: #e4e4e7 !important;
}

html[data-theme="light"] .table-zebra tbody tr:nth-child(even),
html[data-theme="light"] tbody tr:nth-child(even) {
  background-color: #f8fafc !important;
  color: #18181b !important;
}

html[data-theme="light"] .table tbody tr:hover,
html[data-theme="light"] .table-zebra tbody tr:hover {
  background-color: #f1f5f9 !important;
}

html[data-theme="light"] .table thead tr th {
  background-color: #f4f4f5 !important;
  color: #3f3f46 !important;
  border-color: #e4e4e7 !important;
}

html[data-theme="light"] .lang-toggle-btn,
html[data-theme="light"] .theme-toggle-btn,
html[data-theme="light"] aside .btn {
  background-color: #ffffff !important;
  color: #18181b !important;
  border-color: #d4d4d8 !important;
}

html[data-theme="light"] .lang-toggle-btn:hover,
html[data-theme="light"] .theme-toggle-btn:hover,
html[data-theme="light"] aside .btn:hover {
  background-color: #f4f4f5 !important;
  color: #000000 !important;
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background-color: #ffffff !important;
  color: #18181b !important;
  border-color: #d4d4d8 !important;
}

html[data-theme="light"] select,
html[data-theme="light"] .form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234b5563'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2' d='M19 9l-7 7-7-7'%3e%3c/path%3e%3c/svg%3e") !important;
}

html[data-theme="light"] .live-item-enter {
  background-color: #fef2f2 !important;
}
