/* ==========================================
   CSS STYLESHEET: Telegram Dark Theme Web Style
   ========================================== */

/* Resets & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #17212b; /* Official Telegram dark blue chat background */
  color: #f5f6f7;
  font-family: 'Cairo', 'Tajawal', sans-serif;
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #17212b;
}
::-webkit-scrollbar-thumb {
  background: #2b394a;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3e546a;
}

/* Global Grid & Flex Utilities */
.hidden {
  display: none !important;
}

.show-mobile {
  display: none !important;
}

.view-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Toast Notification Container */
#toast-container {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

/* Toast Popup Item */
.toast-alert {
  background: #24303f;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  border-right: 4px solid #2481cc;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  font-size: 14px;
  font-weight: 600;
  min-width: 280px;
  max-width: 400px;
  pointer-events: auto;
  transform: translateX(-120%);
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-alert.show {
  transform: translateX(0);
}

.toast-alert.error {
  border-right-color: #f43f5e;
}

.toast-alert.success {
  border-right-color: #10b981;
}

.toast-alert.warning {
  border-right-color: #f59e0b;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, #2481cc 0%, #1a6aab 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(36, 129, 204, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2a92e4 0%, #1d79c2 100%);
  box-shadow: 0 6px 16px rgba(36, 129, 204, 0.4);
}

.btn-secondary {
  background-color: #24303f;
  color: #b1c3d4;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
  background-color: #2c3c4f;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Spinner Loader */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Inputs & Form Groups */
.input-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.input-group label {
  font-size: 13px;
  font-weight: 600;
  color: #708499;
}

.input-group input,
.input-group select,
.input-group textarea {
  background-color: #17212b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  color: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  border-color: #2481cc;
  box-shadow: 0 0 0 3px rgba(36, 129, 204, 0.15);
}

.input-hint {
  font-size: 11px;
  color: #708499;
}

/* ==========================================
   AUTHENTICATION CARD VIEW
   ========================================== */
#auth-view, #signup-view {
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background-color: #1e2c3a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 40px 30px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-logo {
  margin-bottom: 24px;
}

.auth-title {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 8px;
  color: #fff;
}

.auth-subtitle {
  font-size: 13px;
  color: #708499;
  text-align: center;
  margin-bottom: 30px;
  line-height: 1.5;
}

.auth-card form {
  width: 100%;
  margin-bottom: 20px;
}

.auth-card .btn {
  width: 100%;
  margin-top: 10px;
}

.auth-divider {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 15px 0;
  color: #708499;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-divider span {
  padding: 0 15px;
  font-size: 12px;
}

.auth-switch-mode {
  font-size: 13px;
  color: #708499;
  margin-top: 24px;
}

.auth-switch-mode a {
  color: #2481cc;
  text-decoration: none;
  font-weight: 700;
}

.auth-switch-mode a:hover {
  text-decoration: underline;
}

/* ==========================================
   MAIN DASHBOARD GRID LAYOUT
   ========================================== */
.dashboard-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  background-color: #1e2c3a;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  background: #2481cc;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.user-email {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  background-color: rgba(36, 129, 204, 0.12);
  color: #2481cc;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
  border: 1px solid rgba(36, 129, 204, 0.2);
}

.sidebar-nav {
  padding: 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-tab {
  background: none;
  border: none;
  color: #b1c3d4;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
  text-align: right;
}

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

.nav-tab.active {
  background-color: #2481cc;
  color: #fff;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-logout {
  background: none;
  border: none;
  color: #708499;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  transition: background-color 0.2s, color 0.2s;
}

.btn-logout:hover {
  background-color: rgba(244, 63, 94, 0.1);
  color: #f43f5e;
}

/* Content Area */
.content-area {
  padding: 40px;
  overflow-y: auto;
  height: 100vh;
}

.panel-header {
  margin-bottom: 35px;
}

.panel-title {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 6px;
}

.panel-subtitle {
  font-size: 14px;
  color: #708499;
}

.card {
  background-color: #1e2c3a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 10px;
}

/* ==========================================
   TAB 1: SUBSCRIPTION METRICS & CIRCULAR SVG
   ========================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

/* Status Cards & Progress */
.circular-progress-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  margin: 10px 0;
}

.circular-progress {
  transform: rotate(-90deg);
}

.circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 10;
}

.circle-val {
  fill: none;
  stroke: #2481cc;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.circular-label {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.circular-label .number {
  font-size: 32px;
  font-weight: 900;
  color: #fff;
}

.circular-label .lbl {
  font-size: 11px;
  color: #708499;
  font-weight: 600;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info-label {
  color: #708499;
  font-size: 13px;
}

.info-value {
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.font-highlight {
  color: #2481cc;
}

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

/* Subscription status badges */
.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background-color: rgba(255, 255, 255, 0.06);
  color: #708499;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-badge.active-badge {
  background-color: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.2);
}

.status-badge.expired-badge {
  background-color: rgba(244, 63, 94, 0.12);
  color: #f43f5e;
  border-color: rgba(244, 63, 94, 0.2);
}

/* Engine Status */
.engine-status-wrapper {
  display: flex;
  align-items: center;
  gap: 20px;
}

.engine-icon-glow {
  background: rgba(36, 129, 204, 0.08);
  border: 1px solid rgba(36, 129, 204, 0.15);
  color: #2481cc;
  padding: 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.engine-details {
  flex: 1;
}

.engine-label {
  font-size: 12px;
  color: #708499;
}

.engine-status {
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  margin: 2px 0 6px 0;
}

.engine-hint {
  font-size: 12px;
  color: #708499;
  line-height: 1.5;
}

/* ==========================================
   TAB 2: PLANS & PRICING CARDS
   ========================================== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.price-card {
  background-color: #1e2c3a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s, border-color 0.2s;
}

.price-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
}

.price-card.popular {
  border-color: #2481cc;
  box-shadow: 0 8px 24px rgba(36, 129, 204, 0.15);
}

.price-card.gold {
  border-color: #f59e0b;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
}

.plan-header {
  margin-bottom: 20px;
}

.plan-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.plan-badge.green { background: #10b981; color: #fff; }
.plan-badge.blue { background: #2481cc; color: #fff; }
.plan-badge.discount { background: #8b5cf6; color: #fff; }
.plan-badge.discount-gold { background: #f59e0b; color: #fff; }

.plan-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}

.plan-price {
  font-size: 28px;
  font-weight: 900;
  color: #fff;
}

.plan-price .period {
  font-size: 13px;
  color: #708499;
  font-weight: 500;
}

.plan-features {
  list-style: none;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.plan-features li {
  font-size: 13px;
  color: #b1c3d4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-features li::before {
  content: "✓";
  color: #10b981;
  font-weight: bold;
}

.price-card .btn {
  width: 100%;
  font-size: 13px;
  padding: 10px 15px;
}

/* ==========================================
   TAB 3: CRYPTO BILLING GATEWAY
   ========================================== */
.crypto-billing-layout {
  display: grid;
  grid-template-columns: 1.2fr 1.8fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .crypto-billing-layout {
    grid-template-columns: 1fr;
  }
}

.crypto-network-badge {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
}

.qr-code-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 15px 0 25px 0;
  gap: 8px;
}

.qr-code-placeholder {
  background-color: #fff;
  padding: 10px;
  border-radius: 8px;
  display: inline-block;
}

.qr-hint {
  font-size: 11px;
  color: #708499;
}

.wallet-copy-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wallet-copy-box .label {
  font-size: 12px;
  color: #708499;
}

.copy-input-row {
  display: flex;
  gap: 8px;
}

.copy-input-row input {
  background-color: #17212b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-family: monospace;
  font-size: 12px;
  flex: 1;
  outline: none;
  text-align: left;
}

.copy-input-row .btn {
  padding: 10px 16px;
  font-size: 13px;
  white-space: nowrap;
}

.crypto-submission-form .btn {
  width: 100%;
}

/* ==========================================
   TAB 4: CONNECTION wizard & modals
   ========================================== */
.connection-wizard-layout {
  max-width: 550px;
  margin: 0 auto;
}

.wizard-header {
  margin-bottom: 24px;
  text-align: center;
}

.wizard-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 8px 0;
}

.step-badge {
  font-size: 10px;
  font-weight: 700;
  background-color: rgba(36, 129, 204, 0.12);
  color: #2481cc;
  padding: 3px 10px;
  border-radius: 20px;
  width: fit-content;
  margin: 0 auto;
}

.step-badge.success {
  background-color: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.step-description {
  font-size: 13px;
  color: #708499;
}

.info-link-btn {
  background: none;
  border: none;
  color: #2481cc;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  margin-top: 5px;
  outline: none;
}

.info-link-btn:hover {
  text-decoration: underline;
}

.code-input {
  letter-spacing: 6px;
  text-align: center;
  font-size: 20px !important;
  font-weight: 900;
}

.button-row {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.button-row .btn {
  flex: 1;
}

/* ==========================================
   TAB 5: TEMPLATES LIBRARY
   ========================================== */
.templates-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .templates-layout {
    grid-template-columns: 1fr;
  }
}

.variables-hint {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 15px;
  font-size: 12px;
}

.variables-hint strong {
  display: block;
  margin-bottom: 6px;
  color: #fff;
}

.variables-hint ul {
  list-style: none;
  padding-right: 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.variables-hint code {
  background-color: #24303f;
  color: #f59e0b;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.faq-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.faq-content p {
  font-size: 13px;
  color: #b1c3d4;
  line-height: 1.5;
}

.faq-content strong {
  color: #fff;
}

/* ==========================================
   4. MODALS & CAROUSEL (RTL)
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background-color: #1e2c3a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.close-btn {
  background: none;
  border: none;
  color: #708499;
  font-size: 24px;
  cursor: pointer;
  outline: none;
}

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

.modal-body {
  padding: 24px;
  position: relative;
  min-height: 280px;
}

.guide-slide {
  display: flex;
  flex-direction: column;
}

.slide-media-frame {
  margin-bottom: 16px;
}

.guide-image {
  width: 100%;
  height: 140px;
  object-fit: contain;
  background-color: #17212b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.dummy-media {
  background-color: #17212b;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 15px;
}

.media-icon {
  font-size: 32px;
}

.media-overlay-txt {
  font-size: 11px;
  color: #708499;
  text-align: center;
  line-height: 1.5;
}

.slide-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.slide-text {
  font-size: 13px;
  color: #b1c3d4;
  line-height: 1.6;
}

.slide-action {
  margin-top: 15px;
}

.slide-action .btn {
  font-size: 12px;
  padding: 8px 16px;
}

.link-external {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.font-danger {
  color: #f43f5e;
}

.slide-warning-badge {
  background-color: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: #f43f5e;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  margin-top: 12px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-footer .btn {
  font-size: 13px;
  padding: 8px 16px;
}

.slide-dots {
  display: flex;
  gap: 8px;
}

.slide-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all 0.2s;
}

.slide-dots .dot.active {
  background-color: #2481cc;
  width: 16px;
  border-radius: 4px;
}

/* ==========================================
   ADMIN BACK-OFFICE DASHBOARD STYLES
   ========================================== */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-mini-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-color: #1e2c3a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.stat-label {
  font-size: 12px;
  font-weight: 700;
  color: #708499;
  margin-bottom: 8px;
}

.stat-val {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
}

.green-text { color: #10b981; }
.red-text { color: #f43f5e; }
.blue-text { color: #2481cc; }
.gold-text { color: #f59e0b; }

.admin-tab-headers {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 10px;
}

.admin-sub-tab {
  background: none;
  border: none;
  color: #708499;
  padding: 10px 16px;
  font-weight: 700;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.admin-sub-tab:hover {
  color: #fff;
}

.admin-sub-tab.active {
  color: #fff;
}

.admin-sub-tab.active::after {
  content: "";
  position: absolute;
  bottom: -11px;
  right: 0;
  left: 0;
  height: 3px;
  background-color: #2481cc;
  border-radius: 2px 2px 0 0;
}

.admin-sub-section {
  display: block;
}

.admin-sub-section.hidden {
  display: none !important;
}

.table-card {
  padding: 0;
  overflow: hidden;
}

.table-card .card-title {
  padding: 20px 24px 0 24px;
  border-bottom: none;
  margin-bottom: 15px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
}

.admin-table th, 
.admin-table td {
  padding: 14px 20px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.admin-table th {
  background-color: rgba(255, 255, 255, 0.02);
  color: #708499;
  font-weight: 700;
}

.admin-table td {
  color: #b1c3d4;
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.01);
}

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

.readonly-input {
  background-color: #24303f !important;
  color: #708499 !important;
  cursor: not-allowed;
}

.input-group.checkbox-group {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  margin-top: 10px;
}

.input-group.checkbox-group input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #2481cc;
}

.input-group.checkbox-group label {
  color: #fff;
  cursor: pointer;
  user-select: none;
}

.action-btn-group {
  display: flex;
  gap: 6px;
  justify-content: flex-start;
}

.btn-table {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-approve {
  background-color: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.btn-approve:hover {
  background-color: rgba(16, 185, 129, 0.3);
  color: #fff;
}

.btn-reject {
  background-color: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
}

.btn-reject:hover {
  background-color: rgba(244, 63, 94, 0.3);
  color: #fff;
}

.btn-edit {
  background-color: rgba(36, 129, 204, 0.15);
  color: #2481cc;
}

.btn-edit:hover {
  background-color: rgba(36, 129, 204, 0.3);
  color: #fff;
}

.btn-reboot {
  background-color: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.btn-reboot:hover {
  background-color: rgba(245, 158, 11, 0.3);
  color: #fff;
}

.btn-delete {
  background-color: rgba(225, 29, 72, 0.15);
  color: #e11d48;
}

.btn-delete:hover {
  background-color: rgba(225, 29, 72, 0.3);
  color: #fff;
}

/* Responsive Overrides */
@media (max-width: 768px) {
  /* Global Touch Optimizations */
  * {
    -webkit-tap-highlight-color: transparent;
  }

  .show-mobile {
    display: block !important;
  }
  
  .show-mobile.inline {
    display: inline !important;
  }

  .hidden-mobile {
    display: none !important;
  }

  /* Main Dashboard Layout to stack */
  .dashboard-layout {
    grid-template-columns: 1fr !important;
    display: block !important;
  }
  
  .sidebar {
    position: static !important;
    border: none !important;
    height: auto !important;
  }

  /* Top Navigation / App Header Bar */
  .sidebar-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 60px !important;
    background-color: #1e2c3a !important;
    z-index: 1000 !important;
    padding: 0 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
  }
  
  .sidebar-header .user-info {
    gap: 8px !important;
    width: auto !important;
    justify-content: flex-start !important;
  }
  
  .sidebar-header .user-avatar {
    width: 32px !important;
    height: 32px !important;
    font-size: 11px !important;
  }
  
  .sidebar-header .user-meta {
    gap: 2px !important;
  }
  
  .sidebar-header .user-email {
    font-size: 11px !important;
    max-width: 140px !important;
  }
  
  .sidebar-header .badge {
    font-size: 8px !important;
    padding: 1px 6px !important;
  }

  /* Top Logout Button on Mobile Header */
  .sidebar-footer {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important; /* aligned to opposite of user-info in RTL */
    height: 60px !important;
    z-index: 1001 !important; /* above header */
    border-top: none !important;
    padding: 0 16px !important;
    display: flex !important;
    align-items: center !important;
    background: transparent !important;
  }
  
  .sidebar-footer .btn-logout {
    padding: 8px !important;
    background: transparent !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    margin: 0 !important;
  }
  
  .sidebar-footer .btn-logout span {
    display: none !important;
  }
  
  .sidebar-footer .btn-logout svg {
    width: 20px !important;
    height: 20px !important;
    color: #f43f5e !important; /* red logout icon for premium look */
  }

  /* Bottom Navigation Bar */
  .sidebar-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 64px !important;
    background-color: #1e2c3a !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    z-index: 1000 !important;
    flex-direction: row !important;
    justify-content: space-around !important;
    align-items: center !important;
    padding: 0 4px !important;
    margin: 0 !important;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2) !important;
  }

  .sidebar-nav .nav-tab {
    flex-direction: column !important;
    gap: 4px !important;
    padding: 6px 0 !important;
    font-size: 10px !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 !important;
    background: transparent !important;
    color: #708499 !important;
    text-align: center !important;
    border-radius: 0 !important;
    height: 100% !important;
    margin: 0 !important;
  }
  
  .sidebar-nav .nav-tab.active {
    background: transparent !important;
    color: #2481cc !important;
  }
  
  .sidebar-nav .nav-tab.active svg {
    stroke: #2481cc !important;
  }
  
  .admin-body .sidebar-nav .nav-tab.active {
    color: #e11d48 !important;
  }
  
  .admin-body .sidebar-nav .nav-tab.active svg {
    stroke: #e11d48 !important;
  }
  
  .sidebar-nav .nav-tab svg {
    width: 20px !important;
    height: 20px !important;
    stroke: #708499 !important;
  }

  /* Content Area */
  .content-area {
    padding: 76px 12px 80px 12px !important; /* Space for fixed header and bottom nav */
    height: calc(100vh - 124px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  .panel-header {
    margin-bottom: 20px !important;
  }
  
  .panel-title {
    font-size: 20px !important;
  }
  
  .panel-subtitle {
    font-size: 12px !important;
  }

  /* Metrics Cards & Dashboard Elements */
  .metrics-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  
  .card {
    padding: 16px !important;
    border-radius: 12px !important;
  }

  /* Form layouts */
  .web-form div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Stack maintenance actions */
  .maintenance-action-card {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 14px !important;
    text-align: right !important;
  }
  
  .maintenance-action-card div[style*="flex-grow"] {
    text-align: right !important;
  }
  
  .maintenance-action-card .btn {
    width: 100% !important;
  }

  /* Table styles density */
  .admin-table th, 
  .admin-table td {
    padding: 10px 12px !important;
    font-size: 11px !important;
  }

  /* Headers wrapping flex rows */
  .card-header-flex {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    margin-bottom: 12px !important;
  }
  
  .card-header-flex div {
    justify-content: space-between !important;
    width: 100% !important;
  }

  /* Billing Crypto Overrides */
  .crypto-billing-layout {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  
  .copy-input-row {
    flex-direction: column !important;
    gap: 8px !important;
  }
  
  .copy-input-row .btn {
    width: 100% !important;
  }

  /* Templates library grid layout */
  .templates-layout {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Connection wizard overlay */
  .button-row {
    flex-direction: column-reverse !important;
    gap: 8px !important;
  }
  
  .button-row .btn {
    width: 100% !important;
  }
}

/* Google Sign-in Buttons & Dividers */
.or-separator {
  display: flex;
  align-items: center;
  text-align: center;
  color: #708499;
  margin: 16px 0;
  font-size: 14px;
}
.or-separator::before,
.or-separator::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.or-separator:not(:empty)::before {
  margin-left: .5em;
}
.or-separator:not(:empty)::after {
  margin-right: .5em;
}
.google-btn-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
}
.google-btn-wrapper iframe {
  width: 100% !important;
  margin: 0 auto;
}

