:root {
  --bg-dark: #090e17;
  --bg-card: #121927;
  --bg-input: #0a101d;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #10b981;
  --success-hover: #059669;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --warning: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --transition: all 0.2s ease-in-out;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-container {
  width: 100%;
  max-width: 99%;
  margin: 0 auto;
  padding: 16px 14px;
  flex: 1;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  background: linear-gradient(135deg, #10b981, #3b82f6);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.brand span {
  font-size: 20px;
  display: block;
}

.sub-brand {
  font-size: 12px;
  color: var(--text-muted);
}

.nav-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-info {
  text-align: right;
}

.profile-name {
  display: block;
  font-weight: 700;
  font-size: 14px;
}

.credit-pill {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 8px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.nav-tab:hover { color: var(--text-main); }
.nav-tab.active { background: var(--primary); color: white; }

.special-tab.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

/* Tab Panes Switching */
.tab-pane {
  display: none !important;
}

.tab-pane.active {
  display: block !important;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.central-card {
  max-width: 480px;
  margin: 50px auto;
}

.card-header h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.card-header h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.subtitle { color: var(--text-muted); font-size: 14px; }
.text-center { text-align: center; }

.icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 16px auto;
}

.admin-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

/* Forms */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-group input, .search-input, .filter-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus, .search-input:focus, .filter-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Fix browser autofill blinding white background across all browsers & inputs */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
input:-internal-autofill-selected,
input:-internal-autofill-previewed,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill {
  -webkit-text-fill-color: #f8fafc !important;
  color: #f8fafc !important;
  -webkit-box-shadow: 0 0 0 1000px #0b1329 inset !important;
  box-shadow: 0 0 0 1000px #0b1329 inset !important;
  background-color: #0b1329 !important;
  transition: background-color 9999999s ease-in-out 0s, color 9999999s ease-in-out 0s !important;
  border-color: rgba(99, 102, 241, 0.5) !important;
  caret-color: #ffffff !important;
}

#sub-email:-webkit-autofill,
#sub-email:-webkit-autofill:hover,
#sub-email:-webkit-autofill:focus,
#sub-pass:-webkit-autofill,
#sub-pass:-webkit-autofill:hover,
#sub-pass:-webkit-autofill:focus {
  -webkit-text-fill-color: #f8fafc !important;
  color: #f8fafc !important;
  -webkit-box-shadow: 0 0 0 1000px #090e1d inset !important;
  box-shadow: 0 0 0 1000px #090e1d inset !important;
  background-color: #090e1d !important;
}

/* Styled Input with leading icon wrapper */
.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-leading-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 13.5px;
  pointer-events: none;
  transition: color 0.2s ease, transform 0.2s ease;
  z-index: 2;
}

.input-icon-wrapper:focus-within .input-leading-icon {
  color: #60a5fa;
  transform: translateY(-50%) scale(1.1);
}

.input-icon-wrapper input.with-icon {
  padding-left: 40px !important;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Playlist Type Segmented Selector (Xtream Codes / M3U URL) */
.playlist-type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(10, 16, 29, 0.75);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 20px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.type-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted, #94a3b8);
  padding: 11px 16px;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  user-select: none;
}

.type-btn i {
  font-size: 14px;
  color: var(--text-muted, #94a3b8);
  transition: transform 0.2s ease, color 0.2s ease;
}

.type-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.06);
}

.type-btn:hover i {
  color: #60a5fa;
  transform: scale(1.15);
}

.type-btn:active {
  transform: scale(0.98);
}

.type-btn.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: rgba(147, 197, 253, 0.35);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.type-btn.active i {
  color: #ffffff;
  transform: scale(1.05);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.type-btn .badge-rec {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  letter-spacing: 0.4px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  text-transform: uppercase;
  margin-left: 4px;
  transition: all 0.2s ease;
}

.type-btn.active .badge-rec {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

.helper-text {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Checkbox */
.custom-checkbox {
  display: flex !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px !important;
  color: var(--text-main) !important;
}

.custom-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
  line-height: 1.2;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: var(--success-hover); }
.btn-warning { background: var(--warning); color: #000; }
.btn-warning:hover { background: #d97706; color: #fff; }

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-main);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger-outline {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}
.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--danger);
  color: #ffffff;
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
}

.actions-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  flex-wrap: nowrap;
}

/* Square Icon Action Button (Uniform size, style, and row alignment) */
.btn-icon {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
  font-size: 13.5px !important;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  flex-shrink: 0;
  position: relative;
}

.btn-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

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

/* Hover Tooltip */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #0f172a;
  color: #f8fafc;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  z-index: 999;
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.btn-block { width: 100%; }

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.metric-label { display: block; font-size: 12px; color: var(--text-muted); }
.metric-val { font-size: 22px; font-weight: 800; }
.metric-val-sm { font-size: 13px; font-weight: 700; word-break: break-all; }

/* Tables */
.table-responsive { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.data-table td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13.5px;
}

.data-table th:last-child,
.data-table td:last-child {
  white-space: nowrap;
}

.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.2;
}

.badge-role { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.badge-admin { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-active { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-trial { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-expired { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.badge-suspended { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.badge-subreseller { background: rgba(139, 92, 246, 0.2); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.4); }
.badge-nosub { background: rgba(148, 163, 184, 0.1); color: #94a3b8; }
.badge-open { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-answered { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-closed { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

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

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

.flex-wrap { flex-wrap: wrap; gap: 16px; }
.mt-4 { margin-top: 24px; }
.mb-3 { margin-bottom: 12px; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }

/* Info List */
.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.info-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.info-list i {
  margin-top: 4px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.modal-card img, #popup-display-img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.close-modal-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}
.close-modal-btn:hover { color: var(--text-main); }

.modal-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

.plan-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.plan-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.plan-card:hover, .plan-card.active {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.08);
}

.plan-title { display: block; font-weight: 700; font-size: 15px; }
.plan-cost { font-size: 13px; color: var(--text-muted); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.quick-credentials {
  margin-top: 20px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.quick-credentials ul {
  list-style: none;
  margin-top: 6px;
}

.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  animation: slideIn 0.3s ease-out;
}

.toast-success { background: #059669; color: white; }
.toast-error { background: #dc2626; color: white; }
.hidden { display: none !important; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.btn-warning {
  background: #f59e0b;
  color: #000;
  font-weight: 700;
}
.btn-warning:hover {
  background: #d97706;
}

.custom-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  resize: vertical;
  outline: none;
}
.custom-textarea:focus {
  border-color: var(--primary);
}

/* Downloads Grid & Cards (Requirement 12) */
.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 16px;
}
.download-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.download-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.download-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}
.download-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}
.downloader-code-box {
  background: rgba(229, 9, 38, 0.1);
  border: 1px dashed rgba(229, 9, 38, 0.4);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: #ff2a48;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.download-card-actions {
  display: flex;
  gap: 8px;
}

/* Support Tickets Thread (Requirement 13) */
.ticket-messages-container {
  max-height: 380px;
  overflow-y: auto;
  padding: 14px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ticket-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.ticket-msg-user {
  align-self: flex-start;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.ticket-msg-admin {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(229, 9, 38, 0.25), rgba(184, 0, 23, 0.35));
  border: 1px solid rgba(229, 9, 38, 0.3);
}
.ticket-msg-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ==========================================================================
   MOBILE & SMALL SCREEN RESPONSIVE STYLES
   ========================================================================== */
@media (max-width: 850px) {
  .app-container {
    padding: 16px 14px;
  }

  .navbar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding-bottom: 18px;
    margin-bottom: 20px;
  }

  .brand {
    justify-content: flex-start;
  }

  .brand-icon {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .brand span {
    font-size: 18px;
  }

  .nav-profile {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    gap: 10px;
  }

  .profile-info {
    text-align: left;
  }

  .credit-pill {
    padding: 6px 12px;
    font-size: 13px;
  }

  #nav-edit-profile-btn,
  #reseller-logout-btn {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
  }

  /* Smooth swipeable tab bar */
  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding: 6px;
    margin-bottom: 20px;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 9px 14px;
    font-size: 13px;
  }

  .metrics-grid, .grid-2-col, .form-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card {
    padding: 20px 16px;
  }

  .card-header.flex-between.flex-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .filter-controls .search-input {
    flex: 1 1 100%;
    width: 100%;
  }

  .filter-controls .filter-select {
    flex: 1;
  }

  .filter-controls .btn {
    flex-shrink: 0;
  }

  /* Prevent auto-zoom on iOS Safari */
  .form-group input,
  .search-input,
  .filter-select,
  .custom-textarea {
    font-size: 16px;
    padding: 12px 14px;
  }

  .btn {
    min-height: 42px;
    padding: 11px 16px;
    font-size: 14px;
  }

  .btn-sm {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 12px;
  }

  /* Ticket messages responsive */
  .ticket-msg {
    max-width: 92%;
  }
}

@media (max-width: 600px) {
  .app-container {
    padding: 12px 10px;
  }

  .central-card {
    margin: 16px auto;
    padding: 22px 14px;
  }

  .card-header h2 { font-size: 19px; }
  .card-header h3 { font-size: 16px; }

  /* Table responsive enhancement */
  .table-responsive {
    margin: 0 -10px;
    padding: 0 10px;
    box-shadow: inset -8px 0 8px -8px rgba(0, 0, 0, 0.6);
  }

  .data-table th, .data-table td {
    padding: 10px 10px;
    font-size: 13px;
  }

  .download-card-actions {
    flex-direction: column;
    gap: 8px;
  }

  .download-card-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Centered mobile toast */
  .toast {
    top: 12px;
    left: 12px;
    right: 12px;
    padding: 12px 16px;
    font-size: 13px;
    text-align: center;
    border-radius: var(--radius-md);
  }

  /* Modal on mobile */
  .modal-backdrop {
    padding: 12px;
  }

  .modal-card {
    padding: 20px 16px;
    border-radius: var(--radius-md);
  }

  .playlist-type-selector {
    gap: 6px;
    padding: 4px;
    margin-bottom: 16px;
  }

  .type-btn {
    padding: 10px 8px;
    font-size: 12.5px;
    gap: 6px;
  }

  .type-btn .badge-rec {
    font-size: 9px;
    padding: 1px 5px;
  }

  .modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }

  .plan-card {
    padding: 12px;
  }
}

/* ==========================================================================
   APP THEMES SWITCHER (Super Admin Exclusive)
   ========================================================================== */
.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
  margin-top: 10px;
}

.theme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card, #121829);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.theme-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

.theme-card.active-theme {
  border-color: #10B981;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.28), 0 12px 30px rgba(0, 0, 0, 0.5);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.06) 0%, rgba(18, 24, 41, 0.95) 100%);
}

.theme-preview-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #060913;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.theme-card:hover .theme-preview-box img {
  transform: scale(1.025);
}

.theme-preview-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.theme-preview-status {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.theme-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px;
  gap: 14px;
}

.theme-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.theme-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #FFFFFF;
}

.theme-tagline {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted, #94A3B8);
  line-height: 1.45;
}

.theme-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.theme-features li {
  font-size: 12px;
  color: #CBD5E1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-features li i {
  font-size: 11px;
}

.theme-action {
  margin-top: auto;
  padding-top: 10px;
}

/* ========================================== */
/* LANGUAGE SELECTOR & I18N STYLING           */
/* ========================================== */
.lang-selector-wrapper {
  display: inline-flex;
  align-items: center;
}

.lang-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.lang-select:hover, .lang-select:focus {
  background: rgba(255, 255, 255, 0.14);
  border-color: #ff2a48;
}

.lang-select option {
  background: #111827;
  color: #fff;
  font-size: 14px;
}

/* Styled Optional Protect Radio Cards (Clear, Beautiful, Touch-Friendly) */
.protect-radio-section {
  margin-top: 14px;
  margin-bottom: 8px;
}

.protect-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-normal);
}

.protect-section-header .text-amber {
  color: #f59e0b;
  margin-right: 6px;
}

.protect-radio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 580px) {
  .protect-radio-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.protect-radio-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.22s ease-in-out;
  user-select: none;
}

.protect-radio-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.protect-radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-disc {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: all 0.2s ease;
}

.radio-disc-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
  transform: scale(0);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Active State: Standard Unprotected */
.protect-radio-card#label-protect-none.active {
  background: rgba(16, 185, 129, 0.09);
  border-color: #10b981;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
}

.protect-radio-card#label-protect-none.active .radio-disc {
  border-color: #10b981;
}

.protect-radio-card#label-protect-none.active .radio-disc-dot {
  background: #10b981;
  transform: scale(1);
}

/* Active State: Optional Protect */
.protect-radio-card#label-protect-auto.active {
  background: rgba(245, 158, 11, 0.11);
  border-color: #f59e0b;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.25);
}

.protect-radio-card#label-protect-auto.active .radio-disc {
  border-color: #f59e0b;
}

.protect-radio-card#label-protect-auto.active .radio-disc-dot {
  background: #f59e0b;
  transform: scale(1);
}

.protect-card-text {
  flex: 1;
}

.protect-card-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.protect-card-sub {
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--text-muted);
}

.badge-mini-gold {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* ==========================================================================
   RESTYLED ACTION BUTTONS & PLAYLIST CARD SYSTEM (CMS & User Modals)
   ========================================================================== */
.playlists-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.playlists-container::-webkit-scrollbar {
  width: 6px;
}
.playlists-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.device-pl-item,
.playlist-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 13px 15px;
  margin-bottom: 10px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.device-pl-item:hover,
.playlist-card:hover {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

.device-pl-top,
.playlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  flex-wrap: wrap;
}

.device-pl-meta,
.playlist-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.device-pl-title,
.playlist-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.pl-type-badge,
.pl-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1;
}

.pl-badge-m3u {
  background: rgba(59, 130, 246, 0.18) !important;
  color: #60a5fa !important;
  border: 1px solid rgba(59, 130, 246, 0.35) !important;
}

.pl-badge-xtream {
  background: rgba(168, 85, 247, 0.18) !important;
  color: #c084fc !important;
  border: 1px solid rgba(168, 85, 247, 0.35) !important;
}

.pl-badge-protected,
.pl-badge-locked {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.16) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  line-height: 1;
}

.pl-badge-free {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.14) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  line-height: 1;
}

/* Beautiful Restyled Action Buttons (Edit & Delete) & Playlist Cards */
.device-pl-item.playlist-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  padding: 13px 15px !important;
  margin-bottom: 11px !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.device-pl-item.playlist-card:hover {
  border-color: rgba(99, 102, 241, 0.4) !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025)) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35) !important;
  transform: translateY(-1px);
}

.device-pl-top.playlist-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  width: 100% !important;
  flex-wrap: nowrap !important; /* Critical: never wraps to keep actions on right */
}

.device-pl-meta.playlist-title-group {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
  flex: 1 !important;
  overflow: hidden !important;
}

.playlist-title-left {
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  min-width: 0 !important;
}

.playlist-type-icon {
  color: var(--primary, #e50914) !important;
  font-size: 14px !important;
  flex-shrink: 0 !important;
}

.device-pl-title.playlist-name {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  letter-spacing: -0.2px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.device-pl-actions,
.playlist-actions-group {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
  margin-left: auto !important; /* Forces Edit & Delete buttons to the right side */
}

.btn-pl-action,
.pl-action-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 6px 13px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  outline: none !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  border: 1px solid transparent !important;
}

/* Edit Button: Ultra Sleek Royal Blue Pill */
.btn-pl-edit,
.pl-btn-edit {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(37, 99, 235, 0.28)) !important;
  border: 1px solid rgba(96, 165, 250, 0.45) !important;
  color: #93c5fd !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.18) !important;
}

.btn-pl-edit:hover,
.pl-btn-edit:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
  transform: translateY(-1.5px) !important;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.5) !important;
}

.btn-pl-edit:active,
.pl-btn-edit:active {
  transform: translateY(0) !important;
}

/* Delete Button: Ultra Sleek Crimson Red Pill */
.btn-pl-delete,
.pl-btn-delete {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.16), rgba(220, 38, 38, 0.28)) !important;
  border: 1px solid rgba(248, 113, 113, 0.45) !important;
  color: #fca5a5 !important;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.18) !important;
}

.btn-pl-delete:hover,
.pl-btn-delete:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  transform: translateY(-1.5px) !important;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.5) !important;
}

.btn-pl-delete:active,
.pl-btn-delete:active {
  transform: translateY(0) !important;
}

/* Details Snippet Box & Copy Button */
.device-pl-endpoint-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
}

.device-pl-endpoint-box,
.playlist-details {
  flex: 1 !important;
  min-width: 0 !important;
  background: rgba(0, 0, 0, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  padding: 7px 11px !important;
  font-size: 11.5px !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  color: #cbd5e1 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.btn-copy-endpoint {
  flex-shrink: 0 !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 6px 11px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  line-height: 1 !important;
}

.btn-copy-endpoint:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  transform: translateY(-1px) !important;
}

@media (max-width: 540px) {
  .btn-pl-action span,
  .btn-copy-endpoint span {
    display: none !important;
  }
  .btn-pl-action {
    padding: 6px 10px !important;
  }
}

/* ==========================================================================
   2-COLUMN PLAYLIST MANAGEMENT MODAL (Requirement 4)
   ========================================================================== */
.playlist-modal-card {
  max-width: 1060px !important;
  width: 95vw !important;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.playlist-modal-2col {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 22px;
  align-items: start;
}

.playlist-modal-left {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 18px;
}

.playlist-modal-right {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
}

.playlist-modal-right .playlists-container {
  max-height: 590px;
  overflow-y: auto;
  padding-right: 4px;
}

@media (max-width: 880px) {
  .playlist-modal-2col {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .playlist-modal-right .playlists-container {
    max-height: 380px;
  }
}

/* ==========================================================================
   SUPER ADMIN ANNOUNCEMENT TOGGLE CARD (Requirement 3)
   ========================================================================== */
.announcement-toggle-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 16px;
  user-select: none;
}

.announcement-toggle-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.announcement-toggle-card.active {
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.12), rgba(255, 42, 72, 0.06)) !important;
  border-color: rgba(255, 42, 72, 0.45) !important;
  box-shadow: 0 6px 20px rgba(229, 9, 20, 0.2) !important;
}

.toggle-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.toggle-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.announcement-toggle-card.active .toggle-icon-wrap {
  background: linear-gradient(135deg, #ff2a48, #b80017) !important;
  color: #ffffff !important;
  border-color: #ff2a48 !important;
  box-shadow: 0 4px 14px rgba(229, 9, 20, 0.45) !important;
}

.toggle-card-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.toggle-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
}

.toggle-card-sub {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.35;
}

.toggle-card-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.status-pill-inactive {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.status-pill-active {
  background: rgba(16, 185, 129, 0.18) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
}

/* Modern iOS / SaaS Switch Toggle */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  cursor: pointer;
  margin: 0;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-toggle .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 34px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.switch-toggle .slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.switch-toggle input:checked + .slider {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.switch-toggle input:checked + .slider:before {
  transform: translateX(22px);
  background-color: #ffffff;
}

/* ==========================================================================
   SORTABLE TABLE HEADERS (Requirement 2)
   ========================================================================== */
.sortable-th {
  cursor: pointer !important;
  user-select: none;
  transition: background-color 0.2s, color 0.2s;
}

.sortable-th:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff !important;
}

.sortable-th:hover .sort-icon {
  opacity: 0.9 !important;
}

/* ==========================================================================
   CARD HEADER ICONS & COMMON COMPONENT STYLES
   ========================================================================== */
.card-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}

/* ==========================================================================
   QUICK ACTIVATION PLAN SELECTION CARDS
   ========================================================================== */
.plan-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}

.plan-select-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.plan-select-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.plan-select-card.active {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.12), rgba(5, 150, 105, 0.06)) !important;
  border-color: #10b981 !important;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.25) !important;
}

.plan-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.plan-card-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.plan-select-card.active .plan-card-radio {
  border-color: #10b981;
}

.plan-card-radio .radio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: transparent;
  transition: all 0.2s ease;
}

.plan-select-card.active .plan-card-radio .radio-dot {
  background-color: #10b981;
}

.plan-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.plan-desc {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.4;
}

@media (max-width: 600px) {
  .plan-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   RESELLER PLAYBOOK STEP CARDS
   ========================================================================== */
.playbook-steps-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.playbook-step-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 13px 15px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: all 0.2s ease;
}

.playbook-step-card:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateX(3px);
}

.step-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.25), rgba(255, 42, 72, 0.35));
  border: 1px solid rgba(255, 42, 72, 0.5);
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.step-content strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 3px;
}

.step-content p {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.45;
}

/* ==========================================================================
   HIERARCHY & CREDIT RULE TILES
   ========================================================================== */
.rule-tiles-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.rule-tile {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 13px 15px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: all 0.2s ease;
}

.rule-tile:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateX(3px);
}

.rule-icon-disc {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}

.rule-tile-content strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 3px;
}

.rule-tile-content p {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.45;
}

/* Quick credit chips */
.quick-credit-chips {
  display: flex;
  gap: 6px;
  align-items: center;
}

.credit-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  border-radius: 7px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.credit-chip:hover {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(96, 165, 250, 0.45);
  color: #93c5fd;
  transform: translateY(-1px);
}

.credit-chip.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.45) !important;
  transform: translateY(-1px);
}

/* Executive Sub-reseller Permission Toggle Card */
.sub-permission-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 14px;
  margin-bottom: 8px;
}

.sub-permission-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(99, 102, 241, 0.35);
}

.sub-permission-card.active {
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.12), rgba(0, 0, 0, 0.45));
  border-color: rgba(255, 42, 72, 0.45);
  box-shadow: 0 4px 16px rgba(229, 9, 20, 0.2);
}

.sub-permission-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.sub-permission-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.2), rgba(255, 42, 72, 0.3));
  border: 1px solid rgba(255, 42, 72, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff2a48;
  font-size: 16px;
  flex-shrink: 0;
}

.sub-permission-card.active .sub-permission-icon {
  background: linear-gradient(135deg, #ff2a48, #b80017);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(229, 9, 20, 0.4);
}

.sub-permission-text {
  min-width: 0;
  flex: 1;
}

.sub-permission-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
}

.sub-permission-desc {
  font-size: 11.5px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.35;
}

/* ==========================================================================
   ENHANCED SUB-RESELLER CREATION & FORM STYLING
   ========================================================================== */
.subreseller-create-card {
  background: linear-gradient(180deg, rgba(17, 27, 49, 0.98), rgba(11, 19, 38, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

.subreseller-create-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #6366f1, #ec4899);
}

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

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

.subreseller-create-card label {
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 7px;
}

.subreseller-create-card label i {
  font-size: 13.5px;
}

.subreseller-create-card .input-icon-wrapper input {
  background: #090e1d !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #f8fafc;
  font-size: 14px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.subreseller-create-card .input-icon-wrapper input:focus {
  background: #0d1527 !important;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25), 0 4px 12px rgba(59, 130, 246, 0.15);
}

.sub-info-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.22);
  color: #93c5fd;
  font-size: 12px;
  line-height: 1.5;
}

.sub-info-callout i {
  color: #60a5fa;
  font-size: 14px;
  margin-top: 2px;
  flex-shrink: 0;
}

.btn-subreseller-submit {
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.4);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-subreseller-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.55);
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

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

/* ==========================================================================
   SUPER ADMIN EXECUTIVE HEADER & ANNOUNCEMENT LIVE PREVIEW
   ========================================================================== */
.admin-executive-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.1), rgba(0, 0, 0, 0.4));
  border: 1px solid rgba(255, 42, 72, 0.25);
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 14px;
}

.admin-header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-crown-badge {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff2a48, #b80017);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 20px;
  box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}

.admin-header-brand h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
}

.admin-quick-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Announcement Preview Panel */
.announcement-preview-panel {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.preview-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-mockup-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.mockup-header-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.mockup-header-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.mockup-header-dots span:nth-child(1) { background: #ef4444; }
.mockup-header-dots span:nth-child(2) { background: #f59e0b; }
.mockup-header-dots span:nth-child(3) { background: #10b981; }

.mockup-img-wrap {
  width: 100%;
  max-height: 140px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}

.mockup-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.mockup-title {
  font-size: 16px;
  font-weight: 700;
  color: #ff2a48;
  margin: 0 0 8px 0;
}

.mockup-content {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
  white-space: pre-line;
  margin: 0 0 16px 0;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ==========================================================================
   QUICK ACTIVATION CONFIRMATION POPUP MODAL
   ========================================================================== */
.quick-confirm-modal-card {
  max-width: 520px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.confirm-modal-icon-disc {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.35));
  border: 1px solid rgba(16, 185, 129, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #34d399;
  font-size: 18px;
  flex-shrink: 0;
}

.confirm-summary-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.confirm-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.confirm-label {
  font-size: 13px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.confirm-mac-tag {
  font-family: monospace;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.confirm-status-alert {
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
  transition: all 0.25s ease;
}

.confirm-status-alert .status-alert-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.confirm-status-alert .status-alert-content {
  flex: 1;
  min-width: 0;
}

.confirm-status-alert strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.confirm-status-alert p {
  font-size: 12.5px;
  line-height: 1.45;
  margin: 0;
}

/* Alert state A: Lifetime (Blocked) */
.confirm-status-alert.alert-lifetime {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(0, 0, 0, 0.5));
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.confirm-status-alert.alert-lifetime strong {
  color: #f87171;
}

/* Alert state B: Extending Active Subscription */
.confirm-status-alert.alert-extending {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(0, 0, 0, 0.5));
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #a7f3d0;
}
.confirm-status-alert.alert-extending strong {
  color: #34d399;
}

/* Alert state C: Standard / New / Expired */
.confirm-status-alert.alert-standard {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(0, 0, 0, 0.5));
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #cbd5e1;
}
.confirm-status-alert.alert-standard strong {
  color: #93c5fd;
}

/* Date comparison timeline */
.confirm-dates-timeline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 10px;
}

.date-step {
  display: flex;
  flex-direction: column;
}

.date-step-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  margin-bottom: 2px;
}

.date-step-val {
  font-size: 13.5px;
  font-weight: 700;
  color: #f1f5f9;
  font-family: monospace;
}

.date-step-extended .date-step-val {
  color: #34d399;
  font-size: 14.5px;
}

.date-arrow {
  color: #64748b;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Balance impact card */
.confirm-balance-card {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12.5px;
}

.confirm-balance-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e2e8f0;
}

.confirm-balance-right {
  color: #cbd5e1;
}





