/**
 * Megabit Cloud Custom Theme
 * Custom styling to match megabitcloud.com design
 * Admin Dashboard Style - December 2025
 */

/* ========================================
   CSS Variables - Megabit Cloud Brand Colors
   ======================================== */
:root {
  /* Brand Colors - Dark Sidebar Theme */
  --brand-navy: #2e3993;
  --brand-cyan: #29a7dd;
  --brand-navy-dark: #1a2744;
  --brand-sidebar: #1e2a3a;
  --brand-sidebar-dark: #162231;
  --brand-cyan-light: #4bb8e8;
  
  /* Override Bootstrap Primary */
  --primary: #2e3993;
  --info: #29a7dd;
  
  /* Neutral Colors */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Typography */
  --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  /* Sidebar Width */
  --sidebar-width: 260px;
}

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

body {
  font-family: var(--font-family-base);
  font-size: 0.9375rem; /* 15px - mobile base */
  font-weight: 400;
  line-height: 1.6;
  color: var(--gray-700);
  background-color: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Mobile-first heading sizes */
h1, .h1 { font-size: 1.75rem; }
h2, .h2 { font-size: 1.5rem; }
h3, .h3 { font-size: 1.25rem; }
h4, .h4 { font-size: 1.125rem; }
h5, .h5 { font-size: 1rem; }
h6, .h6 { font-size: 0.875rem; }

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-family-base);
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.3;
}

/* ========================================
   Header Styling
   ======================================== */
.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* When logged in, header uses dark theme */
body.logged-in .header {
  background: var(--brand-sidebar);
  border-bottom: none;
}

.header .navbar {
  padding: 0.75rem 0;
}

.header .navbar-brand {
  padding: 0;
}

.header .logo-img {
  height: 32px;
  width: auto;
}

/* Top Bar for logged in users - Admin Dashboard Style */
.header .topbar {
  background: var(--brand-sidebar);
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 60px;
}

.header .topbar .topbar-brand img {
  height: 32px;
  width: auto;
}

.header .topbar .btn {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
}

.header .topbar .btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Topbar search */
.header .topbar .topbar-search {
  width: 280px;
}

.header .topbar .topbar-search .form-control {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-right: none;
  color: #fff;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius) 0 0 var(--radius);
}

.header .topbar .topbar-search .form-control::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.header .topbar .topbar-search .form-control:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: none;
}

.header .topbar .topbar-search .btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-left: none;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.5rem 1rem;
}

.header .topbar .topbar-search .btn:hover {
  color: #fff;
}

/* Topbar icons */
.header .topbar .topbar-icon {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
}

.header .topbar .topbar-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.header .topbar .topbar-icon .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  font-size: 0.65rem;
  padding: 0.2em 0.5em;
  min-width: 18px;
}

/* Topbar user dropdown */
.header .topbar .topbar-user {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
}

.header .topbar .topbar-user:hover {
  background: rgba(255, 255, 255, 0.15);
}

.header .topbar .topbar-user::after {
  margin-left: 0.5rem;
  opacity: 0.7;
}

.header .topbar .dropdown-menu {
  background: var(--brand-sidebar);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 0.5rem;
  margin-top: 0.5rem;
  min-width: 200px;
  box-shadow: var(--shadow-lg);
}

.header .topbar .dropdown-item {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  padding: 0.625rem 1rem;
  border-radius: var(--radius);
}

.header .topbar .dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.header .topbar .dropdown-item i {
  width: 20px;
  text-align: center;
  opacity: 0.7;
}

.header .topbar .dropdown-divider {
  border-color: rgba(255, 255, 255, 0.1);
  margin: 0.5rem 0;
}

/* Return to admin button */
.header .topbar .btn-return-to-admin {
  background: #f59e0b;
  color: #fff;
  font-weight: 600;
}

.header .topbar .btn-return-to-admin:hover {
  background: #d97706;
}

/* Hide main navbar for logged in users - using topbar instead */
body.logged-in .main-navbar-wrapper {
  display: none;
}

/* Also hide the secondary navbar with logo for logged-in users */
body.logged-in .header .navbar.navbar-light {
  display: none;
}

/* Main Navigation */
.main-navbar-wrapper {
  background: var(--brand-navy);
  padding: 0;
}

.main-navbar-wrapper .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 1rem 1.25rem;
  transition: all 0.2s ease;
}

.main-navbar-wrapper .navbar-nav .nav-link:hover,
.main-navbar-wrapper .navbar-nav .nav-link:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.main-navbar-wrapper .navbar-nav .nav-item.active .nav-link,
.main-navbar-wrapper .navbar-nav .nav-link.active {
  color: var(--brand-cyan);
  background: rgba(255, 255, 255, 0.1);
}

/* Dropdown menus */
.main-navbar-wrapper .dropdown-menu {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  margin-top: 0;
}

.main-navbar-wrapper .dropdown-item {
  color: var(--gray-700);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.625rem 1rem;
  border-radius: var(--radius);
  transition: all 0.15s ease;
}

.main-navbar-wrapper .dropdown-item:hover,
.main-navbar-wrapper .dropdown-item:focus {
  background: var(--gray-50);
  color: var(--gray-900);
}

/* Search box in header */
.header .search .form-control {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.875rem;
}

.header .search .form-control::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.header .search .form-control:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(41, 167, 221, 0.2);
}

.header .search .btn {
  background: var(--brand-cyan);
  border: none;
  color: #fff;
  border-radius: var(--radius) 0 0 var(--radius);
}

/* Cart button */
.header .cart-btn {
  position: relative;
}

.header .cart-btn .badge {
  background: var(--brand-cyan);
  position: absolute;
  top: -2px;
  right: -2px;
  font-size: 0.65rem;
  padding: 0.2em 0.5em;
  border-radius: 9999px;
}

/* ========================================
   Breadcrumb
   ======================================== */
.master-breadcrumb {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  padding: 0.75rem 0;
}

.breadcrumb {
  background: transparent;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
}

.breadcrumb-item a {
  color: var(--brand-navy);
  font-weight: 500;
}

.breadcrumb-item a:hover {
  color: var(--brand-cyan);
  text-decoration: none;
}

.breadcrumb-item.active {
  color: var(--gray-500);
}

/* ========================================
   Buttons - Megabit Cloud Style
   ======================================== */
.btn {
  font-family: var(--font-family-base);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: var(--brand-navy);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--brand-navy-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
}

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

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: var(--brand-navy);
  color: #fff;
  border-color: var(--brand-navy);
}

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

.btn-info:hover,
.btn-info:focus {
  background: var(--brand-cyan-light);
  border-color: var(--brand-cyan-light);
  color: #fff;
}

.btn-success {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}

.btn-success:hover,
.btn-success:focus {
  background: #059669;
  border-color: #059669;
}

.btn-default,
.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.btn-default:hover,
.btn-secondary:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}

/* Large buttons */
.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1.0625rem;
  border-radius: var(--radius-lg);
}

/* ========================================
   Cards - Modern Styling
   ======================================== */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

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

.card-header {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
  padding: 1.25rem 1.5rem;
}

.card-header h3,
.card-header .card-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl) !important;
  padding: 1rem 1.5rem;
}

/* ========================================
   Panels (Bootstrap 3 compatibility)
   ======================================== */
.panel {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.panel-default > .panel-heading,
.panel-heading {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 1rem 1.5rem;
}

.panel-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
}

.panel-body {
  padding: 1.5rem;
}

/* ========================================
   Forms
   ======================================== */
.form-control {
  font-family: var(--font-family-base);
  font-size: 0.9375rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: #fff;
  color: var(--gray-700);
  transition: all 0.2s ease;
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
}

.form-control:focus {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(41, 167, 221, 0.15);
  outline: none;
}

.form-control::placeholder {
  color: var(--gray-400);
}

.form-group label,
.form-label {
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

/* Input groups */
.input-group-text {
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  color: var(--gray-600);
  font-size: 0.9375rem;
}

/* Custom select */
.custom-select,
select.form-control {
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") no-repeat right 0.75rem center/12px 12px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Text inputs and textareas */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

/* ========================================
   Tables
   ======================================== */
.table {
  border-radius: var(--radius);
  overflow: hidden;
}

.table thead th {
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
  color: var(--gray-600);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  padding: 1rem;
}

.table tbody td {
  padding: 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}

.table tbody tr:hover {
  background: var(--gray-50);
}

.table-striped tbody tr:nth-of-type(odd) {
  background: var(--gray-50);
}

.table-list {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
}

/* ========================================
   Alerts
   ======================================== */
.alert {
  border-radius: var(--radius);
  border: none;
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
}

/* ========================================
   Badges
   ======================================== */
.badge {
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.375em 0.75em;
  border-radius: 9999px;
}

.badge-primary,
.badge-info {
  background: var(--brand-navy);
}

.badge-success {
  background: #10b981;
}

.badge-warning {
  background: #f59e0b;
  color: #fff;
}

.badge-danger {
  background: #ef4444;
}

/* ========================================
   Dashboard Layout - Admin Style
   ======================================== */

/* Main body with sidebar layout for logged-in users */
body.logged-in #main-body,
body.megabit-cloud-theme #main-body {
  background: var(--gray-100);
  min-height: calc(100vh - 200px);
}

/* Dark Sidebar Navigation */
.sidebar {
  margin-bottom: 1.5rem;
}

/* When sidebar is in the left column, make it dark */
.col-lg-4 .sidebar,
.col-xl-3 .sidebar {
  background: var(--brand-sidebar);
  border-radius: var(--radius-xl);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.col-lg-4 .sidebar .list-group,
.col-xl-3 .sidebar .list-group {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  border: none;
}

.col-lg-4 .sidebar .list-group-item,
.col-xl-3 .sidebar .list-group-item {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 1.5rem;
  font-weight: 500;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.col-lg-4 .sidebar .list-group-item i,
.col-xl-3 .sidebar .list-group-item i {
  margin-right: 0.75rem;
  width: 20px;
  text-align: center;
  opacity: 0.7;
}

.col-lg-4 .sidebar .list-group-item:last-child,
.col-xl-3 .sidebar .list-group-item:last-child {
  border-bottom: none;
}

.col-lg-4 .sidebar .list-group-item:hover,
.col-xl-3 .sidebar .list-group-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.col-lg-4 .sidebar .list-group-item:hover i,
.col-xl-3 .sidebar .list-group-item:hover i {
  opacity: 1;
}

.col-lg-4 .sidebar .list-group-item.active,
.col-xl-3 .sidebar .list-group-item.active {
  background: rgba(41, 167, 221, 0.2);
  color: var(--brand-cyan);
  border-left: 3px solid var(--brand-cyan);
}

.col-lg-4 .sidebar .list-group-item.active i,
.col-xl-3 .sidebar .list-group-item.active i {
  color: var(--brand-cyan);
  opacity: 1;
}

/* Sidebar Panel Headers - Dark style */
.col-lg-4 .sidebar .panel,
.col-xl-3 .sidebar .panel,
.col-lg-4 .sidebar .card,
.col-xl-3 .sidebar .card {
  background: var(--brand-sidebar);
  border: none;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 1rem;
}

.col-lg-4 .sidebar .panel-heading,
.col-xl-3 .sidebar .panel-heading,
.col-lg-4 .sidebar .card-header,
.col-xl-3 .sidebar .card-header {
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 1.5rem;
}

.col-lg-4 .sidebar .panel-title,
.col-xl-3 .sidebar .panel-title,
.col-lg-4 .sidebar .card-title,
.col-xl-3 .sidebar .card-title {
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.col-lg-4 .sidebar .panel-body,
.col-xl-3 .sidebar .panel-body,
.col-lg-4 .sidebar .card-body,
.col-xl-3 .sidebar .card-body {
  padding: 1rem 1.5rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Sidebar menu header */
.sidebar-header {
  padding: 1.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header img {
  max-height: 40px;
  width: auto;
}

/* ========================================
   Dashboard Stat Tiles - Admin Panel Style
   ======================================== */

/* New Dashboard Tiles matching admin panel */
.dashboard-tiles .dashboard-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: var(--gray-700);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 100px;
}

.dashboard-tiles .dashboard-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--gray-900);
}

.dashboard-tiles .tile-content {
  flex: 1;
  z-index: 1;
}

.dashboard-tiles .tile-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
  margin-bottom: 0.25rem;
}

.dashboard-tiles .tile-stat {
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand-navy);
  line-height: 1.2;
}

.dashboard-tiles .tile-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  opacity: 0.15;
  z-index: 1;
}

.dashboard-tiles .tile-icon.text-primary { color: var(--brand-cyan); }
.dashboard-tiles .tile-icon.text-success { color: #10b981; }
.dashboard-tiles .tile-icon.text-warning { color: #f97316; }
.dashboard-tiles .tile-icon.text-info { color: var(--brand-cyan); }
.dashboard-tiles .tile-icon.text-danger { color: #ef4444; }

.dashboard-tiles .tile-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.dashboard-tiles .tile-accent.accent-blue { background: var(--brand-cyan); }
.dashboard-tiles .tile-accent.accent-green { background: #10b981; }
.dashboard-tiles .tile-accent.accent-orange { background: #f97316; }
.dashboard-tiles .tile-accent.accent-red { background: #ef4444; }
.dashboard-tiles .tile-accent.accent-cyan { background: var(--brand-cyan); }
.dashboard-tiles .tile-accent.accent-purple { background: #8b5cf6; }

/* Legacy tile styles */
.tiles {
  margin-bottom: 2rem;
}

.tiles .tile {
  display: block;
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--gray-700);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  position: relative;
  overflow: hidden;
  height: 100%;
}

.tiles .tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--gray-900);
}

.tiles .tile i {
  font-size: 2.5rem;
  color: var(--gray-300);
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
}

.tiles .tile .stat {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--brand-navy);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.tiles .tile .title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.tiles .tile .highlight {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
}

/* Tile colors */
.tiles .tile .highlight.bg-color-blue { background: var(--brand-cyan); }
.tiles .tile .highlight.bg-color-green { background: #10b981; }
.tiles .tile .highlight.bg-color-red { background: #ef4444; }
.tiles .tile .highlight.bg-color-gold { background: #f59e0b; }
.tiles .tile .highlight.bg-color-purple { background: #8b5cf6; }

/* ========================================
   Dashboard Cards
   ======================================== */
.client-home-cards .card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.client-home-cards .card-header {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.client-home-cards .card-header .card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0;
  display: flex;
  align-items: center;
}

.client-home-cards .card-header .card-title i {
  margin-right: 0.5rem;
  color: var(--brand-cyan);
}

.client-home-cards .card-body {
  padding: 1.5rem;
}

.client-home-cards .list-group-item {
  border: none;
  border-bottom: 1px solid var(--gray-100);
  padding: 1rem 1.5rem;
  transition: background 0.15s ease;
}

.client-home-cards .list-group-item:last-child {
  border-bottom: none;
}

.client-home-cards .list-group-item:hover {
  background: var(--gray-50);
}

/* Card accent colors (left border) */
.card-accent-blue { border-left: 4px solid var(--brand-cyan) !important; }
.card-accent-green { border-left: 4px solid #10b981 !important; }
.card-accent-red { border-left: 4px solid #ef4444 !important; }
.card-accent-gold,
.card-accent-yellow { border-left: 4px solid #f59e0b !important; }
.card-accent-purple { border-left: 4px solid #8b5cf6 !important; }
.card-accent-teal { border-left: 4px solid #14b8a6 !important; }
.card-accent-orange { border-left: 4px solid #f97316 !important; }
.card-accent-midnight-blue { border-left: 4px solid var(--brand-navy) !important; }
.card-accent-pomegranate { border-left: 4px solid #ef4444 !important; }
.card-accent-sun-flower { border-left: 4px solid #f59e0b !important; }
.card-accent-asbestos { border-left: 4px solid var(--gray-500) !important; }

/* Background color utilities */
.bg-color-blue { background: var(--brand-cyan) !important; color: #fff !important; }
.bg-color-green { background: #10b981 !important; color: #fff !important; }
.bg-color-red { background: #ef4444 !important; color: #fff !important; }
.bg-color-gold { background: #f59e0b !important; color: #fff !important; }
.bg-color-purple { background: #8b5cf6 !important; color: #fff !important; }

/* ========================================
   Primary Content Area
   ======================================== */
.primary-content {
  background: transparent;
}

.primary-content > .card,
.primary-content > .panel,
.primary-content > form > .card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

/* ========================================
   Footer
   ======================================== */
#footer.footer {
  background: #000;
  color: rgba(255, 255, 255, 0.8);
  padding: 3rem 0 2rem;
  border-top: none;
}

#footer a {
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s ease;
}

#footer a:hover {
  color: var(--brand-cyan);
  text-decoration: none;
}

#footer .nav-link {
  padding: 0.375rem 0.75rem;
  font-weight: 500;
}

#footer .copyright {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  margin-top: 1.5rem;
}

/* Social icons in footer */
#footer .btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.2s ease;
}

#footer .btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--brand-cyan);
}

/* Language/Currency modal in footer */
#footer .modal-localisation .modal-content {
  background: var(--gray-800);
  border: none;
  border-radius: var(--radius-xl);
}

#footer .modal-localisation .item-selector .item {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  color: #fff;
}

#footer .modal-localisation .item-selector .item.active,
#footer .modal-localisation .item-selector .item:hover {
  background: var(--brand-cyan);
  border-color: var(--brand-cyan);
}

/* ========================================
   Homepage Specific Styles
   ======================================== */

/* Domain search box */
.domain-checker-container,
.domain-search-container {
  background: linear-gradient(135deg, var(--brand-navy) 0%, #1e2563 100%);
  padding: 3rem 0;
  margin-bottom: 2rem;
}

.domain-checker-container h2,
.domain-search-container h2 {
  color: #fff;
  font-weight: 700;
}

.domain-checker-container .form-control,
.domain-search-container .form-control {
  height: 56px;
  font-size: 1.0625rem;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  border: 2px solid transparent;
}

.domain-checker-container .btn,
.domain-search-container .btn {
  height: 56px;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  font-size: 1rem;
  padding: 0 2rem;
}

/* Product cards on homepage */
.card-columns.home .card {
  border-radius: var(--radius-xl);
  transition: all 0.3s ease;
}

.card-columns.home .card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-columns.home .card-title {
  color: var(--brand-navy);
  font-weight: 700;
}

/* Action icon buttons on homepage */
.action-icon-btns a {
  display: block;
  padding: 1.5rem;
  text-align: center;
  background: #fff;
  border-radius: var(--radius-xl);
  color: var(--gray-700);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.action-icon-btns a:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  color: #fff;
}

.action-icon-btns .ico-container {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xl);
  background: var(--gray-100);
  font-size: 1.5rem;
  transition: all 0.3s ease;
}

/* Accent colors for action buttons */
.action-icon-btns .card-accent-teal:hover { background: #14b8a6; }
.action-icon-btns .card-accent-teal:hover .ico-container { background: rgba(255,255,255,0.2); color: #fff; }

.action-icon-btns .card-accent-pomegranate:hover { background: #ef4444; }
.action-icon-btns .card-accent-pomegranate:hover .ico-container { background: rgba(255,255,255,0.2); color: #fff; }

.action-icon-btns .card-accent-sun-flower:hover { background: #f59e0b; }
.action-icon-btns .card-accent-sun-flower:hover .ico-container { background: rgba(255,255,255,0.2); color: #fff; }

.action-icon-btns .card-accent-asbestos:hover { background: var(--gray-500); }
.action-icon-btns .card-accent-asbestos:hover .ico-container { background: rgba(255,255,255,0.2); color: #fff; }

.action-icon-btns .card-accent-green:hover { background: #10b981; }
.action-icon-btns .card-accent-green:hover .ico-container { background: rgba(255,255,255,0.2); color: #fff; }

.action-icon-btns .card-accent-midnight-blue:hover { background: var(--brand-navy); }
.action-icon-btns .card-accent-midnight-blue:hover .ico-container { background: rgba(255,255,255,0.2); color: #fff; }

/* ========================================
   Client Area Specific
   ======================================== */

/* Service/Product status badges */
.label-success, .label-active {
  background: #10b981;
  color: #fff;
  padding: 0.25em 0.75em;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.label-warning, .label-pending {
  background: #f59e0b;
  color: #fff;
}

.label-danger, .label-cancelled, .label-terminated {
  background: #ef4444;
  color: #fff;
}

.label-info, .label-suspended {
  background: #3b82f6;
  color: #fff;
}

/* Stats/Overview boxes in client area */
.clientarea-home-stat,
.stat-block {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: all 0.3s ease;
}

.clientarea-home-stat:hover,
.stat-block:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.clientarea-home-stat .stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--brand-navy);
}

/* ========================================
   Shopping Cart
   ======================================== */
.order-summary {
  background: var(--gray-50);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
}

.order-summary .total {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-navy);
}

.cart-body .product-item {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

/* ========================================
   Modals
   ======================================== */
.modal-content {
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--gray-200);
  padding: 1.25rem 1.5rem;
}

.modal-title {
  font-weight: 600;
  color: var(--gray-900);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid var(--gray-200);
  padding: 1rem 1.5rem;
}

/* ========================================
   Pagination
   ======================================== */
.pagination {
  gap: 0.25rem;
}

.page-link {
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
  font-weight: 500;
  padding: 0.5rem 0.875rem;
}

.page-link:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  color: var(--brand-navy);
}

.page-item.active .page-link {
  background: var(--brand-navy);
  border-color: var(--brand-navy);
  color: #fff;
}

/* ========================================
   Links
   ======================================== */
a {
  color: var(--brand-navy);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--brand-cyan);
  text-decoration: none;
}

/* ========================================
   Domain Pricing Table
   ======================================== */
.domain-pricing .tld-pricing-header div {
  background: var(--brand-navy) !important;
  border-color: var(--brand-cyan) !important;
  color: #fff;
  font-weight: 600;
}

.domain-pricing .tld-row:hover {
  background: var(--gray-50);
}

.domain-pricing .tld-row.highlighted {
  background: rgba(41, 167, 221, 0.1);
}

/* ========================================
   Knowledgebase
   ======================================== */
.kb-article-list .list-group-item {
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  border: 1px solid var(--gray-200);
}

.kb-article-list .list-group-item:hover {
  background: var(--gray-50);
  border-color: var(--brand-cyan);
}

/* ========================================
   Support Tickets
   ======================================== */
.ticket-reply {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.ticket-reply.staff-reply {
  background: rgba(41, 167, 221, 0.1);
  border-left: 4px solid var(--brand-cyan);
}

.ticket-reply.client-reply {
  background: var(--gray-50);
  border-left: 4px solid var(--gray-400);
}

/* ========================================
   Announcements
   ======================================== */
.announcement-single {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.announcement-single .announcement-title {
  color: var(--brand-navy);
  font-weight: 700;
}

/* ========================================
   Invoice/Quote Templates - Megabit Cloud Style
   ======================================== */
.invoice-container,
.quote-container {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 2rem;
}

/* Invoice Wrapper */
.invoice-wrapper {
  background: var(--gray-50);
  min-height: 100vh;
  padding: 2rem 1rem;
}

.invoice-wrapper .container-fluid {
  max-width: 1200px;
  margin: 0 auto;
}

/* Invoice Inner Left (Main Content) */
.invoice-inner-left {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  border: 1px solid var(--gray-200);
}

/* Invoice Inner Right (Sidebar) */
.invoice-inner-right {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  border: 1px solid var(--gray-200);
  position: sticky;
  top: 1.5rem;
}

/* Invoice Status Badges */
.invoice-state {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.invoice-state.draft {
  background: linear-gradient(135deg, var(--gray-500) 0%, var(--gray-600) 100%);
  color: #fff;
}

.invoice-state.unpaid {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.invoice-state.paid {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.invoice-state.refunded {
  background: linear-gradient(135deg, var(--brand-cyan) 0%, var(--brand-navy) 100%);
  color: #fff;
}

.invoice-state.cancelled {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.invoice-state.collections {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: #fff;
}

/* Invoice Header Section */
.upper-invoice-head-section {
  margin-bottom: 2rem;
}

.invoice-number {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
}

.invoice-date-section {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  border: 1px solid var(--gray-200);
}

.invoice-date-section li {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.invoice-date-section li:not(:last-child) {
  border-bottom: 1px solid var(--gray-200);
}

.label-left-sec-invoice {
  color: var(--gray-500);
  font-size: 0.875rem;
}

.label-right-sec-invoice {
  font-weight: 600;
  color: var(--gray-900);
}

/* Pay To Section */
.invoice-pay-to-section {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid var(--gray-200);
}

.head-pay-to {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-navy);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.invoice-payto-section address {
  font-style: normal;
  color: var(--gray-700);
  line-height: 1.7;
}

/* Invoice Items Table */
.invoice-item-section,
.invoice-transaction-section {
  margin-bottom: 2rem;
}

.iteam-heading-tbl {
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand-navy);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--brand-cyan);
  display: inline-block;
}

.invoice-item-section .table,
.invoice-transaction-section .table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

.invoice-item-section .table thead td,
.invoice-item-section .table thead th,
.invoice-transaction-section .table thead td,
.invoice-transaction-section .table thead th {
  background: linear-gradient(135deg, var(--brand-navy) 0%, #1e2563 100%);
  color: #fff;
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1rem;
  border: none;
}

.invoice-item-section .table tbody td,
.invoice-transaction-section .table tbody td {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  background: #fff;
}

.invoice-item-section .table tbody tr:nth-child(even) td,
.invoice-transaction-section .table tbody tr:nth-child(even) td {
  background: var(--gray-50);
}

.sub-total-row td,
.total-row-inv td,
.inv-balance-row td {
  background: var(--gray-50) !important;
}

.total-row-inv td {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--brand-navy) !important;
}

.inv-balance-row td {
  font-weight: 600;
  color: var(--gray-900);
}

/* Invoice Right Sidebar */
.invoice-right-first-section {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.total-amount-section {
  background: linear-gradient(135deg, var(--brand-navy) 0%, #1e2563 100%);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.due-amount-heading {
  display: block;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.due-amount-total {
  display: block;
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
}

.payment-gateway-section {
  margin-bottom: 1rem;
}

.payment-gateway-section h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.payment-gateway-section select.form-control {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  color: var(--gray-700);
}

.payment-method-button {
  margin-top: 1rem;
}

.payment-method-button .btn,
.payment-method-button input[type="submit"],
.payment-method-button button {
  width: 100%;
  background: linear-gradient(135deg, var(--brand-cyan) 0%, var(--brand-navy) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.875rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.payment-method-button .btn:hover,
.payment-method-button input[type="submit"]:hover,
.payment-method-button button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46, 57, 147, 0.3);
}

/* Invoice Actions */
.invoice-actions {
  margin-top: 1.5rem;
}

.invoice-actions h3.actions-invoice {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 1rem;
}

.invoice-actions .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none;
}

.invoice-actions .btn.w-hidden,
.invoice-actions .btn.previous-page-link {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.invoice-actions .btn.w-hidden:hover,
.invoice-actions .btn.previous-page-link:hover {
  background: var(--gray-200);
}

.invoice-actions .btn.down-btn {
  background: var(--brand-cyan);
  color: #fff;
  border: none;
}

.invoice-actions .btn.down-btn:hover {
  background: var(--brand-navy);
}

/* Manual Credit Section */
.mannual-credit-section {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--gray-200);
}

.mannual-credit-section h2 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--brand-navy);
  margin-bottom: 0.75rem;
}

.mannual-credit-section input.form-control {
  margin: 0.75rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  padding: 0.625rem 1rem;
}

.mannual-credit-section .btn {
  background: var(--brand-navy);
  color: #fff;
  border: none;
  padding: 0.625rem 1rem;
  border-radius: var(--radius);
  font-weight: 500;
  width: 100%;
  margin-top: 0.5rem;
}

/* Invoice Notes */
.invoice-note-section {
  margin-top: 2rem;
}

.invoice-note-section .panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--brand-cyan);
  background: rgba(41, 167, 221, 0.05);
}

/* Invoice Alert Messages */
.invoice-all-messages .panel {
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

/* Custom Field Invoice */
.custom-field-invoice {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-200);
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* ========================================
   Login/Register Pages
   ======================================== */
.login-container,
.register-container {
  max-width: 480px;
  margin: 2rem auto;
}

.login-container .card,
.register-container .card {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.login-container .card-header,
.register-container .card-header {
  background: var(--brand-navy);
  color: #fff;
  text-align: center;
  padding: 2rem;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
}

.login-container .card-header h3,
.register-container .card-header h3 {
  color: #fff;
  margin: 0;
}

/* ========================================
   Dashboard Hero & Stats
   ======================================== */
.dashboard-hero {
  padding: 2rem;
  background: linear-gradient(135deg, rgba(46, 57, 147, 0.05) 0%, rgba(41, 167, 221, 0.05) 100%);
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
}

.avatar-circle {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #2e3993 0%, #29a7dd 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
  text-transform: uppercase;
}

/* Stat Cards */
.stat-card {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: all 0.3s ease;
  height: 100%;
}

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

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-card-services .stat-icon {
  background: rgba(46, 57, 147, 0.1);
  color: #2e3993;
}

.stat-card-domains .stat-icon {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.stat-card-tickets .stat-icon {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

.stat-card-invoices .stat-icon {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

/* Action Cards */
.action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: #fff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  text-decoration: none;
  color: var(--gray-700);
  transition: all 0.3s ease;
  text-align: center;
  height: 100%;
}

.action-card:hover {
  text-decoration: none;
  color: var(--gray-900);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: var(--brand-cyan);
}

.action-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.action-card span {
  font-weight: 600;
  font-size: 0.875rem;
}

/* Text color helpers */
.text-purple {
  color: #8b5cf6 !important;
}

/* ========================================
   Hide Disabled Features
   Announcements, Knowledgebase, Network Status disabled
   These features are not used - info provided on megabitcloud.com
   ======================================== */

/* Hide Announcements links */
a[href*="announcements"],
a[href*="announcements.php"],
.nav-link[href*="announcements"],
.dropdown-item[href*="announcements"],
.list-group-item[href*="announcements"],
.sidebar a[href*="announcements"] {
  display: none !important;
}

/* Hide Knowledgebase links */
a[href*="knowledgebase"],
a[href*="knowledgebase.php"],
.nav-link[href*="knowledgebase"],
.dropdown-item[href*="knowledgebase"],
.list-group-item[href*="knowledgebase"],
.sidebar a[href*="knowledgebase"] {
  display: none !important;
}

/* Hide Network Status links */
a[href*="serverstatus"],
a[href*="serverstatus.php"],
a[href*="networkissues"],
.nav-link[href*="serverstatus"],
.dropdown-item[href*="serverstatus"],
.list-group-item[href*="serverstatus"],
.sidebar a[href*="serverstatus"],
.sidebar a[href*="networkissues"] {
  display: none !important;
}

/* Hide the search boxes that search knowledgebase */
.header form[action*="knowledgebase"],
.topbar form[action*="knowledgebase"],
.topbar .topbar-search {
  display: none !important;
}

/* Hide network issues notification banner */
.network-issues-wrapper,
#networkIssuesHome {
  display: none !important;
}

/* Hide parent menu items if they only contain disabled children */
/* This targets empty dropdowns after hiding items */
.nav-item.dropdown:has(> .dropdown-menu:empty) {
  display: none !important;
}

/* ========================================
   MOBILE-FIRST RESPONSIVE DESIGN
   Base styles are mobile, scale up with min-width
   Breakpoints match Tailwind: sm:640px, md:768px, lg:1024px, xl:1280px
   ======================================== */

/* ----------------------------------------
   Base Mobile Styles (< 640px)
   These override the base typography for mobile specifics
   ---------------------------------------- */

/* Header - compact on mobile */
.header .logo-img {
  height: 28px;
}

.header .topbar {
  padding: 0.5rem 0;
  min-height: 56px;
}

.header .topbar .topbar-brand img {
  height: 28px;
}

.header .topbar .topbar-search {
  display: none;
}

.header .topbar .topbar-user {
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
}

.header .topbar .topbar-user span {
  display: none;
}

.header .topbar .topbar-icon {
  width: 36px;
  height: 36px;
}

/* Navigation - stack on mobile */
.main-navbar-wrapper .navbar-collapse {
  background: var(--brand-navy);
  padding: 1rem;
  margin: 0 -15px;
}

.main-navbar-wrapper .navbar-nav .nav-link {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
}

.main-navbar-wrapper .dropdown-menu {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  box-shadow: none;
}

.main-navbar-wrapper .dropdown-item {
  color: rgba(255, 255, 255, 0.9);
}

.main-navbar-wrapper .dropdown-item:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Cards - tighter padding on mobile */
.card-body {
  padding: 1rem;
}

.card-header {
  padding: 1rem;
}

.panel-body {
  padding: 1rem;
}

/* Footer - compact on mobile */
#footer {
  padding: 2rem 0 1rem;
  text-align: center;
}

#footer .footer-logo {
  margin-bottom: 1.5rem;
}

#footer .col-lg-3,
#footer .col-md-3,
#footer .col-md-6 {
  margin-bottom: 1.5rem;
}

/* Dashboard tiles - stack on mobile */
.dashboard-tiles .col-md-6,
.dashboard-tiles .col-lg-3 {
  margin-bottom: 1rem;
}

.dashboard-tiles .tile-stat {
  font-size: 1.5rem;
}

.dashboard-tiles .tile-icon {
  width: 40px;
  height: 40px;
  font-size: 1.25rem;
}

/* Dashboard hero - compact on mobile */
.dashboard-hero {
  padding: 1.25rem;
  text-align: center;
}

.dashboard-hero .avatar-circle {
  width: 48px;
  height: 48px;
  font-size: 1rem;
  margin: 0 auto 1rem;
}

.dashboard-hero .d-flex {
  flex-direction: column;
}

.dashboard-hero h1 {
  font-size: 1.5rem;
}

/* Stat cards - smaller on mobile */
.stat-card {
  padding: 1rem;
  flex-direction: column;
  text-align: center;
}

.stat-icon {
  width: 48px;
  height: 48px;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.stat-number {
  font-size: 1.5rem;
}

.stat-label {
  font-size: 0.75rem;
}

/* Action cards - smaller on mobile */
.action-card {
  padding: 1rem 0.75rem;
}

.action-icon {
  width: 48px;
  height: 48px;
  font-size: 1.25rem;
}

.action-card span {
  font-size: 0.75rem;
}

/* Sidebar - hidden on mobile, becomes overlay */
.sidebar-menu {
  position: fixed;
  left: -100%;
  top: 0;
  width: 280px;
  height: 100%;
  z-index: 1050;
  transition: left 0.3s ease;
  overflow-y: auto;
}

.sidebar-menu.show {
  left: 0;
}

/* Main content - full width on mobile */
.main-content,
.primary-content {
  width: 100%;
  padding: 1rem;
}

/* Forms - full width inputs on mobile */
.form-control {
  font-size: 16px; /* Prevents iOS zoom */
}

.form-group label {
  font-size: 0.875rem;
}

/* Buttons - full width on mobile for CTAs */
.btn-block-mobile {
  display: block;
  width: 100%;
}

/* Tables - responsive on mobile */
.table-responsive-mobile {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Login container - tighter on mobile */
.login-container {
  padding: 1rem 0;
}

.login-container .card-body {
  padding: 1.5rem !important;
}

/* Homepage login - compact */
.homepage-login-container {
  padding: 1rem 0;
}

.welcome-banner {
  text-align: center;
  padding: 1.5rem !important;
}

.welcome-banner .text-md-right {
  text-align: center !important;
  margin-top: 1rem;
}

/* ----------------------------------------
   Small screens (sm: 640px and up)
   ---------------------------------------- */
@media (min-width: 640px) {
  body {
    font-size: 0.9375rem;
  }
  
  .header .logo-img {
    height: 30px;
  }
  
  .header .topbar .topbar-brand img {
    height: 30px;
  }
  
  .header .topbar .topbar-user span {
    display: inline;
  }
  
  .card-body {
    padding: 1.25rem;
  }
  
  .login-container .card-body {
    padding: 2rem !important;
  }
  
  .homepage-login-container {
    padding: 1.5rem 0;
  }
}

/* ----------------------------------------
   Medium screens (md: 768px and up)
   ---------------------------------------- */
@media (min-width: 768px) {
  body {
    font-size: 1rem;
  }
  
  h1, .h1 { font-size: 2rem; }
  h2, .h2 { font-size: 1.75rem; }
  h3, .h3 { font-size: 1.375rem; }
  h4, .h4 { font-size: 1.25rem; }
  
  .header .logo-img {
    height: 32px;
  }
  
  .header .topbar {
    padding: 0.75rem 0;
    min-height: 60px;
  }
  
  .header .topbar .topbar-brand img {
    height: 32px;
  }
  
  .header .topbar .topbar-icon {
    width: 40px;
    height: 40px;
  }
  
  .header .topbar .topbar-user {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  
  .card-body {
    padding: 1.5rem;
  }
  
  .card-header {
    padding: 1.25rem 1.5rem;
  }
  
  .panel-body {
    padding: 1.5rem;
  }
  
  #footer {
    padding: 3rem 0 1.5rem;
    text-align: left;
  }
  
  #footer .col-md-6 {
    margin-bottom: 0;
  }
  
  .welcome-banner {
    text-align: left;
    padding: 2rem !important;
  }
  
  .welcome-banner .text-md-right {
    text-align: right !important;
    margin-top: 0;
  }
  
  .dashboard-tiles .tile-stat {
    font-size: 1.75rem;
  }
  
  .dashboard-tiles .tile-icon {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }
  
  /* Dashboard hero - tablet and up */
  .dashboard-hero {
    padding: 2rem;
    text-align: left;
  }
  
  .dashboard-hero .avatar-circle {
    width: 56px;
    height: 56px;
    font-size: 1.25rem;
    margin: 0;
  }
  
  .dashboard-hero .d-flex {
    flex-direction: row;
  }
  
  .dashboard-hero h1 {
    font-size: 1.75rem;
  }
  
  /* Stat cards - horizontal layout on tablet */
  .stat-card {
    padding: 1.25rem;
    flex-direction: row;
    text-align: left;
  }
  
  .stat-icon {
    margin-bottom: 0;
  }
  
  .stat-number {
    font-size: 1.75rem;
  }
  
  .stat-label {
    font-size: 0.8125rem;
  }
  
  /* Action cards - larger on tablet */
  .action-card {
    padding: 1.25rem 1rem;
  }
  
  .action-icon {
    width: 52px;
    height: 52px;
    font-size: 1.375rem;
  }
  
  .action-card span {
    font-size: 0.8125rem;
  }
  
  .homepage-login-container {
    padding: 2rem 0;
  }
  
  .login-container .card-body {
    padding: 2.5rem !important;
  }
}

/* ----------------------------------------
   Large screens (lg: 1024px and up)
   ---------------------------------------- */
@media (min-width: 1024px) {
  h1, .h1 { font-size: 2.25rem; }
  h2, .h2 { font-size: 1.875rem; }
  h3, .h3 { font-size: 1.5rem; }
  
  .header .topbar .topbar-search {
    display: block;
    width: 280px;
  }
  
  /* Main navbar resets for desktop */
  .main-navbar-wrapper .navbar-collapse {
    background: transparent;
    padding: 0;
    margin: 0;
  }
  
  .main-navbar-wrapper .navbar-nav .nav-link {
    padding: 1rem 1.25rem;
    border-radius: 0;
  }
  
  .main-navbar-wrapper .dropdown-menu {
    background: #fff;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
  }
  
  .main-navbar-wrapper .dropdown-item {
    color: var(--gray-700);
  }
  
  .main-navbar-wrapper .dropdown-item:hover {
    background: var(--gray-50);
    color: var(--gray-900);
  }
  
  /* Sidebar visible on desktop */
  .sidebar-menu {
    position: relative;
    left: 0;
    width: var(--sidebar-width);
    height: auto;
    z-index: auto;
  }
  
  .main-content,
  .primary-content {
    padding: 1.5rem;
  }
  
  #footer {
    padding: 4rem 0 2rem;
  }
  
  .dashboard-tiles .tile-stat {
    font-size: 2rem;
  }
  
  .dashboard-tiles .tile-icon {
    width: 56px;
    height: 56px;
    font-size: 1.75rem;
  }
  
  /* Dashboard - desktop enhancements */
  .stat-card {
    padding: 1.5rem;
  }
  
  .stat-icon {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .action-card {
    padding: 1.5rem 1rem;
  }
  
  .action-icon {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
  }
  
  .action-card span {
    font-size: 0.875rem;
  }
}

/* ----------------------------------------
   Extra large screens (xl: 1280px and up)
   ---------------------------------------- */
@media (min-width: 1280px) {
  h1, .h1 { font-size: 2.5rem; }
  h2, .h2 { font-size: 2rem; }
  
  .header .topbar .topbar-search {
    width: 320px;
  }
  
  .container {
    max-width: 1200px;
  }
  
  .main-content,
  .primary-content {
    padding: 2rem;
  }
}

/* ----------------------------------------
   2XL screens (2xl: 1536px and up)
   ---------------------------------------- */
@media (min-width: 1536px) {
  .container {
    max-width: 1400px;
  }
}

/* ========================================
   Utility Classes
   ======================================== */
.text-brand-navy { color: var(--brand-navy) !important; }
.text-brand-cyan { color: var(--brand-cyan) !important; }
.bg-brand-navy { background-color: var(--brand-navy) !important; }
.bg-brand-cyan { background-color: var(--brand-cyan) !important; }

.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }

.shadow-megabit { box-shadow: var(--shadow-md) !important; }

/* Smooth transitions for interactive elements */
.btn,
.card,
.form-control,
.nav-link,
.list-group-item {
  transition: all 0.2s ease-in-out;
}

/* Remove focus outline and use custom focus styles */
*:focus {
  outline: none;
}

.btn:focus,
.form-control:focus,
a:focus {
  box-shadow: 0 0 0 3px rgba(41, 167, 221, 0.3);
}

/* ========================================
   Homepage Login Page Styles
   ======================================== */
.homepage-login-container {
  padding: 2rem 0;
  min-height: calc(100vh - 300px);
}

.min-vh-75 {
  min-height: 75vh;
}

.homepage-login-container .card {
  border: none;
}

.homepage-login-container .form-control-lg {
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border-radius: var(--radius);
}

.homepage-login-container .input-group-text {
  border-color: var(--gray-300);
}

.homepage-login-container .form-control {
  border-color: var(--gray-300);
}

.homepage-login-container .form-control:focus {
  border-color: var(--brand-cyan);
}

/* Welcome banner for logged-in users */
.welcome-banner {
  border-radius: var(--radius-xl);
}

/* ========================================
   Hide Store/Shopping Elements
   Products are purchased from megabitcloud.com
   ======================================== */

/* Hide store links in navigation */
.navbar a[href*="/store"],
.navbar a[href*="cart.php?a=add"],
.sidebar a[href*="/store"],
.list-group-item[href*="/store"] {
  /* Uncomment to hide completely: display: none !important; */
}

/* Style for "Browse Products" external links */
a[href*="megabitcloud.com/products"] {
  background: var(--brand-cyan);
  color: #fff !important;
}

a[href*="megabitcloud.com/products"]:hover {
  background: var(--brand-cyan-light);
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
  .header,
  #footer,
  .sidebar,
  .master-breadcrumb {
    display: none !important;
  }
  
  .primary-content {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ========================================
   Tailwind Integration - Custom Field Styling
   ======================================== */

/* Style WHMCS-generated custom field inputs */
.custom-field-input input[type="text"],
.custom-field-input input[type="email"],
.custom-field-input input[type="tel"],
.custom-field-input input[type="number"],
.custom-field-input input[type="password"],
.custom-field-input textarea,
.custom-field-input select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  color: #111827;
  background-color: #fff;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.custom-field-input input:focus,
.custom-field-input textarea:focus,
.custom-field-input select:focus {
  outline: none;
  border-color: transparent;
  box-shadow: 0 0 0 2px #29a7dd;
}

/* Captcha container styling for Tailwind pages */
.captcha-container,
#divDynamicRecaptcha,
.g-recaptcha {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0;
}

/* Registration page - linked accounts styling */
.linked-accounts-container .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

/* Password strength meter integration */
#passwordStrengthMeterBar {
  transition: width 0.3s ease;
}

/* Generate password button styling */
.generate-password:hover {
  background-color: #e5e7eb !important;
}

/* ========================================
   Form Controls Override (High Specificity)
   Fix for squeezed inputs and selects
   ======================================== */
body .form-control,
.main-content .form-control,
.card .form-control,
.panel .form-control,
.modal .form-control {
  display: block;
  width: 100% !important;
  min-height: 44px !important;
  height: auto !important;
  padding: 0.625rem 1rem !important;
  font-size: 0.9375rem !important;
  font-weight: 400;
  line-height: 1.5;
  color: var(--gray-700);
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  box-sizing: border-box !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body select.form-control,
.main-content select.form-control,
.card select.form-control,
.panel select.form-control,
.modal select.form-control {
  padding-right: 2.5rem !important;
  background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") no-repeat right 0.75rem center/12px 12px !important;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

body textarea.form-control,
.main-content textarea.form-control,
.card textarea.form-control {
  min-height: 100px !important;
  resize: vertical;
}

body .form-control:focus,
.main-content .form-control:focus,
.card .form-control:focus {
  border-color: var(--brand-cyan) !important;
  box-shadow: 0 0 0 3px rgba(41, 167, 221, 0.15) !important;
  outline: none !important;
}

/* Input groups fix */
.input-group .form-control {
  flex: 1 1 auto;
  width: 1% !important;
  min-width: 0;
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 0.625rem 1rem;
  font-size: 0.9375rem;
  background-color: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
}

/* Select2 and custom dropdown fixes */
.select2-container--bootstrap4 .select2-selection {
  min-height: 44px !important;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
  line-height: 32px;
}

/* Bootstrap-select fixes */
.bootstrap-select .dropdown-toggle {
  min-height: 44px !important;
  padding: 0.625rem 1rem !important;
}

/* DataTables search and length selector fixes */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  min-height: 38px !important;
  padding: 0.5rem 0.75rem !important;
  border: 1px solid var(--gray-300) !important;
  border-radius: var(--radius) !important;
}

.dataTables_wrapper .dataTables_length select {
  padding-right: 2rem !important;
}

/* ========================================
   Global Form Override (High Specificity)
   Ensures all inputs/selects are properly sized
   ======================================== */
body .form-control,
body input.form-control,
body select.form-control,
body textarea.form-control,
.card-body .form-control,
.modal-body .form-control,
form .form-control {
  display: block;
  width: 100% !important;
  min-height: 44px !important;
  padding: 0.625rem 1rem !important;
  font-size: 0.9375rem !important;
  font-weight: 400;
  line-height: 1.5;
  color: var(--gray-700);
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid var(--gray-300) !important;
  border-radius: var(--radius) !important;
  box-sizing: border-box !important;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

body select.form-control,
.card-body select.form-control,
.modal-body select.form-control,
form select.form-control,
body .custom-select,
form .custom-select {
  padding-right: 2.5rem !important;
  background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") no-repeat right 0.75rem center/12px 12px !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}

/* Inline selects in forms (like on cancellation page) */
.d-inline-block .form-control,
.d-inline-block select.form-control,
span.d-inline-block select.form-control,
.form-inline select.form-control,
.select-inline {
  display: inline-block !important;
  width: auto !important;
  min-width: 200px;
  vertical-align: middle;
}

/* Textarea specific */
body textarea.form-control,
form textarea.form-control {
  min-height: 100px !important;
  resize: vertical;
}

/* Fix for small form controls */
.form-control-sm {
  min-height: 36px !important;
  padding: 0.375rem 0.75rem !important;
  font-size: 0.875rem !important;
}

/* Fix for large form controls */
.form-control-lg {
  min-height: 52px !important;
  padding: 0.75rem 1.25rem !important;
  font-size: 1.125rem !important;
}

/* ========================================
   Focus State Overrides
   Fix for persistent focus ring issue
   ======================================== */
body .form-control:not(:focus),
body input.form-control:not(:focus),
body select.form-control:not(:focus),
body textarea.form-control:not(:focus),
form .form-control:not(:focus),
.card .form-control:not(:focus) {
  border-color: var(--gray-300) !important;
  box-shadow: none !important;
  outline: none !important;
}

body .form-control:focus,
body input.form-control:focus,
body select.form-control:focus,
body textarea.form-control:focus,
form .form-control:focus,
.card .form-control:focus {
  border-color: var(--brand-cyan) !important;
  box-shadow: 0 0 0 3px rgba(41, 167, 221, 0.15) !important;
  outline: none !important;
}

/* Remove default browser focus styles */
input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: none;
}

/* Focus-visible for keyboard navigation */
.form-control:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--brand-cyan) !important;
  box-shadow: 0 0 0 3px rgba(41, 167, 221, 0.15) !important;
  outline: none !important;
}

/* ========================================
   International Telephone Input (intlTelInput)
   Fixes for phone number field styling
   ======================================== */

/* Main container */
.iti {
  display: block !important;
  width: 100% !important;
  position: relative !important;
}

/* The actual phone input field - needs extra padding for flag + dial code */
/* intlTelInput sets inline styles, so we need very high specificity */
.iti input,
.iti input.form-control,
.iti input[type="tel"],
.iti__tel-input,
body .iti input[type="tel"],
body .iti input.form-control,
form .iti input[type="tel"],
.card-body .iti input[type="tel"] {
  width: 100% !important;
  min-height: 44px !important;
  padding-left: 100px !important;
  padding-right: 1rem !important;
  border: 1px solid var(--gray-300) !important;
  border-radius: var(--radius) !important;
  font-size: 0.9375rem !important;
  background-color: #fff !important;
}

/* When separate dial code is enabled, need much more padding */
/* The library adds inline padding-left, we need to override it */
.iti--separate-dial-code input,
.iti--separate-dial-code input.form-control,
.iti--separate-dial-code input[type="tel"],
body .iti--separate-dial-code input,
body .iti--separate-dial-code input[type="tel"],
form .iti--separate-dial-code input[type="tel"] {
  padding-left: 115px !important;
}

/* Allow dropdown mode needs similar padding */
.iti--allow-dropdown input,
.iti--allow-dropdown input.form-control,
.iti--allow-dropdown input[type="tel"] {
  padding-left: 58px !important;
}

/* Combined mode */
.iti--allow-dropdown.iti--separate-dial-code input,
.iti--allow-dropdown.iti--separate-dial-code input.form-control,
.iti--allow-dropdown.iti--separate-dial-code input[type="tel"],
body .iti--allow-dropdown.iti--separate-dial-code input,
body .iti--allow-dropdown.iti--separate-dial-code input[type="tel"] {
  padding-left: 115px !important;
}

/* Force the flag container to have a fixed width so padding can be consistent */
.iti--separate-dial-code .iti__selected-flag,
.iti--allow-dropdown.iti--separate-dial-code .iti__selected-flag {
  min-width: 90px !important;
  max-width: 105px !important;
}

/* Country selector flag button */
.iti__flag-container {
  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  padding: 0 !important;
  z-index: 1 !important;
}

.iti__selected-flag {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  height: 100% !important;
  padding: 0 12px !important;
  background: #f8fafc !important;
  border-right: 1px solid var(--gray-200) !important;
  border-radius: var(--radius) 0 0 var(--radius) !important;
  cursor: pointer !important;
  gap: 6px !important;
}

.iti__selected-flag:hover {
  background: #f1f5f9 !important;
}

/* Dial code displayed in the flag area */
.iti__selected-dial-code {
  font-size: 0.9375rem !important;
  color: var(--gray-600) !important;
  margin-left: 4px !important;
  font-weight: 500 !important;
}

/* Flag icon */
.iti__flag {
  display: inline-block !important;
  width: 20px !important;
  height: 15px !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
}

/* Arrow dropdown indicator */
.iti__arrow {
  margin-left: 6px !important;
  border-left: 4px solid transparent !important;
  border-right: 4px solid transparent !important;
  border-top: 5px solid var(--gray-600) !important;
}

.iti__arrow--up {
  border-top: none !important;
  border-bottom: 5px solid var(--gray-600) !important;
}

/* Country dropdown list */
.iti__country-list {
  position: absolute !important;
  z-index: 9999 !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 4px 0 0 0 !important;
  background: #fff !important;
  border: 1px solid var(--gray-200) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
  max-height: 250px !important;
  overflow-y: auto !important;
  width: 300px !important;
}

.iti__country {
  display: flex !important;
  align-items: center !important;
  padding: 10px 12px !important;
  cursor: pointer !important;
  transition: background 0.15s ease !important;
}

.iti__country:hover {
  background: var(--gray-50) !important;
}

.iti__country.iti__highlight {
  background: var(--gray-100) !important;
}

.iti__country-name {
  flex: 1 !important;
  margin-left: 8px !important;
  font-size: 0.875rem !important;
  color: var(--gray-700) !important;
}

.iti__dial-code {
  color: var(--gray-500) !important;
  font-size: 0.8125rem !important;
  margin-left: 8px !important;
}

/* Divider for preferred countries */
.iti__divider {
  border-bottom: 1px solid var(--gray-200) !important;
  margin: 4px 0 !important;
  padding: 0 !important;
}

/* Search box in dropdown (if enabled) */
.iti__search-input {
  width: calc(100% - 24px) !important;
  margin: 8px 12px !important;
  padding: 8px 12px !important;
  border: 1px solid var(--gray-300) !important;
  border-radius: var(--radius) !important;
  font-size: 0.875rem !important;
}

.iti__search-input:focus {
  border-color: var(--brand-cyan) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(41, 167, 221, 0.15) !important;
}

/* Focus state for phone input */
.iti input:focus,
.iti input.form-control:focus,
.iti input[type="tel"]:focus {
  border-color: var(--brand-cyan) !important;
  box-shadow: 0 0 0 3px rgba(41, 167, 221, 0.15) !important;
  outline: none !important;
}

/* When dropdown is open, highlight the flag button */
.iti--container {
  z-index: 9999 !important;
}

/* Separate dropdown mode */
.iti--separate-dial-code .iti__selected-flag {
  background: var(--gray-50) !important;
}

.iti--separate-dial-code .iti__selected-dial-code {
  margin-left: 6px !important;
  font-size: 0.875rem !important;
  color: var(--gray-600) !important;
}

/* Allow dropdown mode */
.iti--allow-dropdown .iti__selected-flag {
  cursor: pointer !important;
}

/* Fix for input-group with phone */
.input-group .iti {
  flex: 1 1 auto !important;
  width: 1% !important;
  min-width: 0 !important;
}

.input-group .iti input {
  border-radius: 0 var(--radius) var(--radius) 0 !important;
}

/* Legacy phone input wrapper (Bootstrap style) */
.phone-input-group,
.tel-input-wrapper {
  display: flex !important;
  width: 100% !important;
}

.phone-input-group .input-group-prepend,
.phone-input-group .input-group-text {
  display: flex !important;
  align-items: center !important;
  padding: 0 12px !important;
  background: var(--gray-50) !important;
  border: 1px solid var(--gray-300) !important;
  border-right: none !important;
  border-radius: var(--radius) 0 0 var(--radius) !important;
  font-size: 0.9375rem !important;
  color: var(--gray-600) !important;
  min-height: 44px !important;
}

/* Fix broken "+" display */
.input-group-prepend .input-group-text,
.input-group > .input-group-prepend > .input-group-text {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 44px !important;
  padding: 0 12px !important;
  background: var(--gray-50) !important;
  border: 1px solid var(--gray-300) !important;
  border-right: none !important;
  border-radius: var(--radius) 0 0 var(--radius) !important;
  font-size: 1rem !important;
  color: var(--gray-600) !important;
}

.input-group > .input-group-prepend + .form-control,
.input-group > .input-group-prepend + input {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

/* ========================================
   intlTelInput OLD CLASS NAMES Override
   WHMCS uses .intl-tel-input not .iti
   ======================================== */

/* Old class container */
.intl-tel-input {
  display: block !important;
  width: 100% !important;
  position: relative !important;
}

/* Override ALL separate-dial-code padding classes - add 20px extra to each */
.intl-tel-input.separate-dial-code.iti-sdc-2 input,
.intl-tel-input.separate-dial-code.iti-sdc-2 input[type=text],
.intl-tel-input.separate-dial-code.iti-sdc-2 input[type=tel] {
  padding-left: 86px !important;
}

.intl-tel-input.separate-dial-code.iti-sdc-2 .selected-flag {
  width: 80px !important;
}

.intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-2 input,
.intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-2 input[type=text],
.intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-2 input[type=tel] {
  padding-left: 96px !important;
}

.intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-2 .selected-flag {
  width: 90px !important;
}

.intl-tel-input.separate-dial-code.iti-sdc-3 input,
.intl-tel-input.separate-dial-code.iti-sdc-3 input[type=text],
.intl-tel-input.separate-dial-code.iti-sdc-3 input[type=tel] {
  padding-left: 94px !important;
}

.intl-tel-input.separate-dial-code.iti-sdc-3 .selected-flag {
  width: 88px !important;
}

.intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-3 input,
.intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-3 input[type=text],
.intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-3 input[type=tel] {
  padding-left: 104px !important;
}

.intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-3 .selected-flag {
  width: 98px !important;
}

.intl-tel-input.separate-dial-code.iti-sdc-4 input,
.intl-tel-input.separate-dial-code.iti-sdc-4 input[type=text],
.intl-tel-input.separate-dial-code.iti-sdc-4 input[type=tel] {
  padding-left: 102px !important;
}

.intl-tel-input.separate-dial-code.iti-sdc-4 .selected-flag {
  width: 96px !important;
}

.intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-4 input,
.intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-4 input[type=text],
.intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-4 input[type=tel] {
  padding-left: 112px !important;
}

.intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-4 .selected-flag {
  width: 106px !important;
}

.intl-tel-input.separate-dial-code.iti-sdc-5 input,
.intl-tel-input.separate-dial-code.iti-sdc-5 input[type=text],
.intl-tel-input.separate-dial-code.iti-sdc-5 input[type=tel] {
  padding-left: 110px !important;
}

.intl-tel-input.separate-dial-code.iti-sdc-5 .selected-flag {
  width: 104px !important;
}

.intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-5 input,
.intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-5 input[type=text],
.intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-5 input[type=tel] {
  padding-left: 120px !important;
}

.intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-5 .selected-flag {
  width: 114px !important;
}

/* Style the old class flag container */
.intl-tel-input .flag-container {
  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 1 !important;
}

.intl-tel-input .selected-flag {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
  padding: 0 10px !important;
  background: #f8fafc !important;
  border-right: 1px solid var(--gray-200) !important;
  border-radius: var(--radius) 0 0 var(--radius) !important;
  cursor: pointer !important;
}

.intl-tel-input .selected-flag:hover {
  background: #f1f5f9 !important;
}

.intl-tel-input .selected-dial-code {
  font-size: 0.9375rem !important;
  color: var(--gray-600) !important;
  margin-left: 6px !important;
  font-weight: 500 !important;
}

/* Old class input styling */
.intl-tel-input input,
.intl-tel-input input.form-control,
.intl-tel-input input[type="tel"] {
  width: 100% !important;
  min-height: 44px !important;
  border: 1px solid var(--gray-300) !important;
  border-radius: var(--radius) !important;
  font-size: 0.9375rem !important;
  background-color: #fff !important;
}

/* Old class country list */
.intl-tel-input .country-list {
  z-index: 9999 !important;
  background: #fff !important;
  border: 1px solid var(--gray-200) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
  max-height: 250px !important;
  overflow-y: auto !important;
}

.intl-tel-input .country-list .country {
  padding: 10px 12px !important;
}

.intl-tel-input .country-list .country:hover {
  background: var(--gray-50) !important;
}

.intl-tel-input .country-list .country.highlight {
  background: var(--gray-100) !important;
}

/* ========================================
   Registration & Login Page Improvements
   ======================================== */

/* Ensure form inputs on registration page are properly visible */
#frmCheckout input[type="text"],
#frmCheckout input[type="email"],
#frmCheckout input[type="password"],
#frmCheckout input[type="tel"],
#frmCheckout select,
#frmCheckout textarea {
  display: block !important;
  width: 100% !important;
  min-height: 48px !important;
  padding: 0.75rem 1rem !important;
  font-size: 1rem !important;
  line-height: 1.5 !important;
  color: #1f2937 !important;
  background-color: #fff !important;
  border: 1px solid #d1d5db !important;
  border-radius: 0.5rem !important;
  box-sizing: border-box !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#frmCheckout input:focus,
#frmCheckout select:focus,
#frmCheckout textarea:focus {
  border-color: #29a7dd !important;
  box-shadow: 0 0 0 3px rgba(41, 167, 221, 0.15) !important;
  outline: none !important;
}

/* Phone input specific fix for registration */
#frmCheckout .intl-tel-input {
  display: block !important;
  width: 100% !important;
}

#frmCheckout .intl-tel-input input[type="tel"] {
  padding-left: 90px !important;
}

/* Custom field inputs on registration */
#frmCheckout .custom-field-input input,
#frmCheckout .custom-field-input select,
#frmCheckout .custom-field-input textarea {
  width: 100% !important;
  min-height: 48px !important;
}

/* Ensure labels are visible */
#frmCheckout label {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: #374151 !important;
  font-weight: 500 !important;
  margin-bottom: 0.375rem !important;
}

/* Card sections */
#frmCheckout .bg-white {
  background-color: #fff !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}
