/* ==========================================================================
   WHM INDIA BUSINESS HUB — MASTER CSS
   Styles for Admin Console, Client Portal, Cart Checkout & GST Invoicing
   ========================================================================== */

:root {
  --hub-primary: #4f46e5;
  --hub-primary-hover: #4338ca;
  --hub-primary-light: #eef2ff;
  --hub-secondary: #0ea5e9;
  --hub-dark: #0f172a;
  --hub-card-bg: #ffffff;
  --hub-bg: #f8fafc;
  --hub-border: #e2e8f0;
  --hub-text-main: #1e293b;
  --hub-text-muted: #64748b;
  --hub-success: #10b981;
  --hub-success-light: #ecfdf5;
  --hub-warning: #f59e0b;
  --hub-warning-light: #fffbeb;
  --hub-danger: #ef4444;
  --hub-danger-light: #fef2f2;
}

body.hub-body {
  background-color: var(--hub-bg);
  color: var(--hub-text-main);
  font-family: 'Plus Jakarta Sans', sans-serif;
  margin: 0;
  padding: 0;
}

/* Master Layout */
.hub-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.hub-sidebar {
  width: 260px;
  background: #0f172a;
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: all 0.3s ease;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid #1e293b;
}

.hub-brand {
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hub-brand .logo-text {
  font-size: 1.15rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
}

.hub-brand .logo-text span {
  color: #38bdf8;
}

.hub-brand .badge-role {
  background: rgba(79, 70, 229, 0.3);
  color: #a5b4fc;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  margin-top: 2px;
  display: inline-block;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.hub-nav {
  padding: 20px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hub-nav-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 12px 14px 6px;
}

.hub-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.2s ease;
  cursor: pointer;
}

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

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

.hub-nav-item.active {
  background: var(--hub-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.hub-nav-item .badge-count {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
}

.hub-nav-item.active .badge-count {
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
}

.hub-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Main Content Area */
.hub-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Hub Header */
.hub-header {
  height: 70px;
  background: #fff;
  border-bottom: 1px solid var(--hub-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.hub-header-title h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--hub-dark);
  margin: 0;
}

.hub-header-title p {
  font-size: 0.78rem;
  color: var(--hub-text-muted);
  margin: 2px 0 0 0;
}

.hub-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Hub Viewports / Tabs */
.hub-content {
  padding: 32px;
  flex: 1;
}

.hub-view {
  display: none;
}

.hub-view.active {
  display: block;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.kpi-card {
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  border: 1px solid var(--hub-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

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

.kpi-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--hub-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--hub-dark);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.kpi-footer {
  margin-top: 10px;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-indigo { background: #e0e7ff; color: #4338ca; }
.icon-emerald { background: #d1fae5; color: #059669; }
.icon-cyan { background: #cffafe; color: #0891b2; }
.icon-amber { background: #fef3c7; color: #d97706; }
.icon-rose { background: #ffe4e6; color: #e11d48; }

/* Data Tables */
.hub-table-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--hub-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  overflow: hidden;
  margin-bottom: 30px;
}

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

.hub-table-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--hub-dark);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hub-table-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hub-search-input {
  position: relative;
}

.hub-search-input input {
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--hub-border);
  border-radius: 10px;
  font-size: 0.85rem;
  width: 240px;
  outline: none;
  background: #f8fafc;
  transition: all 0.2s;
}

.hub-search-input input:focus {
  border-color: var(--hub-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.hub-search-input i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.85rem;
}

.hub-table-responsive {
  overflow-x: auto;
}

.hub-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.hub-table th {
  background: #f8fafc;
  padding: 14px 20px;
  color: #475569;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--hub-border);
  white-space: nowrap;
}

.hub-table td {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.hub-table tr:hover td {
  background: #f8fafc;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-active, .badge-paid { background: var(--hub-success-light); color: var(--hub-success); }
.badge-unpaid, .badge-pending { background: var(--hub-warning-light); color: var(--hub-warning); }
.badge-suspended, .badge-overdue { background: var(--hub-danger-light); color: var(--hub-danger); }
.badge-closed { background: #f1f5f9; color: #64748b; }
.badge-info { background: #e0f2fe; color: #0284c7; }

/* Action Buttons */
.btn-action-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--hub-border);
  background: #fff;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-action-icon:hover {
  background: var(--hub-primary-light);
  color: var(--hub-primary);
  border-color: var(--hub-primary);
}

.btn-action-icon.danger:hover {
  background: var(--hub-danger-light);
  color: var(--hub-danger);
  border-color: var(--hub-danger);
}

/* Modals */
.hub-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.hub-modal-overlay.active {
  display: flex;
}

.hub-modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 640px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: modalEnter 0.2s ease-out;
}

.hub-modal-lg {
  max-width: 840px;
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.hub-modal-header {
  padding: 20px 24px;
  background: #f8fafc;
  border-bottom: 1px solid var(--hub-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hub-modal-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--hub-dark);
}

.hub-modal-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.hub-modal-close:hover {
  color: var(--hub-danger);
}

.hub-modal-body {
  padding: 24px;
  max-height: 75vh;
  overflow-y: auto;
}

.hub-modal-footer {
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid var(--hub-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Forms */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--hub-border);
  border-radius: 10px;
  font-size: 0.88rem;
  font-family: inherit;
  background: #fff;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--hub-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* ==========================================================================
   WHMCS CART & ORDER WIZARD STYLES
   ========================================================================== */
.cart-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  position: relative;
}

.cart-step {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 700;
}

.cart-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.cart-step.active {
  color: var(--hub-primary);
}

.cart-step.active .cart-step-num {
  background: var(--hub-primary);
  color: #fff;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
}

.cart-step.completed .cart-step-num {
  background: var(--hub-success);
  color: #fff;
}

.cart-plan-card {
  background: #fff;
  border: 2px solid var(--hub-border);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.2s;
}

.cart-plan-card.selected {
  border-color: var(--hub-primary);
  background: #f8faff;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.08);
}

.billing-cycle-radio {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border: 1px solid var(--hub-border);
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 10px;
  background: #fff;
  transition: all 0.2s;
}

.billing-cycle-radio:hover {
  border-color: #cbd5e1;
}

.billing-cycle-radio.active {
  border-color: var(--hub-primary);
  background: #eef2ff;
}

.addon-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--hub-border);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.addon-card:hover {
  border-color: #cbd5e1;
}

.addon-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--hub-primary);
}

.order-summary-box {
  background: #fff;
  border: 1px solid var(--hub-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  position: sticky;
  top: 90px;
}

.order-summary-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.88rem;
  color: #475569;
}

.order-summary-line.total {
  border-top: 2px solid #0f172a;
  padding-top: 14px;
  font-size: 1.25rem;
  font-weight: 900;
  color: #0f172a;
}

.payment-gateway-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 2px solid var(--hub-border);
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 12px;
  background: #fff;
  transition: all 0.2s;
}

.payment-gateway-option.selected {
  border-color: var(--hub-primary);
  background: #eef2ff;
}

/* Official Indian GST Invoice Design */
.gst-invoice-paper {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 36px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: #0f172a;
  max-width: 760px;
  margin: 0 auto;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.gst-inv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.gst-inv-badge {
  background: #0f172a;
  color: #fff;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 8px;
}

.gst-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.gst-info-box {
  background: #f8fafc;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-size: 0.82rem;
  line-height: 1.5;
}

.gst-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.gst-table th {
  background: #0f172a;
  color: #fff;
  padding: 10px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: left;
}

.gst-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.82rem;
}

.gst-totals-box {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 24px;
}

.gst-totals-table {
  width: 320px;
  border-collapse: collapse;
}

.gst-totals-table td {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.gst-totals-table tr.grand-total td {
  border-top: 2px solid #0f172a;
  border-bottom: 2px solid #0f172a;
  font-size: 1.05rem;
  font-weight: 900;
  color: #0f172a;
  padding: 10px 12px;
}

.gst-payment-footer {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  padding-top: 16px;
  border-top: 1px dashed #cbd5e1;
  font-size: 0.8rem;
}

@media print {
  body * {
    visibility: hidden;
  }
  .gst-invoice-paper, .gst-invoice-paper * {
    visibility: visible;
  }
  .gst-invoice-paper {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    border: none;
    box-shadow: none;
    padding: 0;
  }
  .hub-modal-footer, .hub-modal-header, .no-print {
    display: none !important;
  }
}
