:root {
  --bg: #000000;
  --bg-gradient: none;
  --surface: #0a0a0c;
  --surface-glass: #0a0a0c;
  --surface-2: #121215;
  --surface-hover: #18181c;
  --border: #222226;
  --border-focus: #ffffff;
  --text: #ffffff;
  --text-muted: #8e8e93;
  --text-dim: #5c5c62;
  
  /* Ultra-High Performance Monochrome Palette (Zero Lag / 120 FPS) */
  --primary: #ffffff;
  --primary-contrast: #000000;
  --primary-hover: #e5e5ea;
  --primary-glow: none;
  --primary-gradient: #ffffff;
  
  --success: #f4f4f5;
  --success-bg: #141417;
  --warning: #e4e4e7;
  --warning-bg: #161619;
  --danger: #ff453a;
  --danger-bg: rgba(255, 69, 58, 0.12);
  --info: #ffffff;
  --info-bg: #141417;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-full: 9999px;
  --shadow: none;
  --shadow-sm: none;
  --font: "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Fira Code", "JetBrains Mono", Consolas, monospace;
  --transition: all 0.15s ease;
}

html[data-theme="light"] {
  --bg: #ffffff;
  --bg-gradient: none;
  --surface: #f8fafc;
  --surface-glass: #f8fafc;
  --surface-2: #f1f5f9;
  --surface-hover: #e2e8f0;
  --border: #e2e8f0;
  --border-focus: #0f172a;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --primary: #0f172a;
  --primary-contrast: #ffffff;
  --primary-hover: #1e293b;
  --primary-glow: none;
  --primary-gradient: #0f172a;
  --shadow: none;
  --shadow-sm: none;
}

html[dir="ltr"],
html[dir="ltr"] body {
  direction: ltr;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* Completely remove/hide all scrollbars across all elements while maintaining full smooth scrolling */
html, body, *, *::before, *::after {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

::-webkit-scrollbar, *::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

::-webkit-scrollbar-thumb, *::-webkit-scrollbar-thumb {
  display: none !important;
}

::-webkit-scrollbar-button, *::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

::-webkit-scrollbar-corner, *::-webkit-scrollbar-corner {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Fast Hardware-Accelerated Micro-Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: var(--text);
}

/* Layout */
.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  width: 260px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  height: 100vh;
  z-index: 40;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

html[dir="ltr"] .sidebar {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid var(--border);
}

.sidebar-header {
  padding: 22px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.12);
  transition: transform 0.3s ease, border-color 0.3s ease;
  flex-shrink: 0;
}

.brand:hover .brand-logo {
  transform: rotate(15deg) scale(1.06);
  border-color: #ffffff;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand-sub {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  flex: 1;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  text-align: right;
  font-weight: 500;
  font-size: 13.5px;
  transition: var(--transition);
}

html[dir="ltr"] .nav-item {
  text-align: left;
}

.nav-item svg {
  flex-shrink: 0;
  stroke: var(--text-muted);
  transition: var(--transition);
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-item:hover svg {
  stroke: var(--text);
}

.nav-item.active {
  background: var(--surface-2);
  color: #ffffff;
  font-weight: 600;
  border: 1px solid var(--border);
  border-right: 2px solid #ffffff;
}

html[dir="ltr"] .nav-item.active {
  border-right: 1px solid var(--border);
  border-left: 2px solid #ffffff;
}

.nav-item.active svg {
  stroke: #ffffff;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
}

.user-chip {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-chip strong {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-chip span {
  font-size: 11px;
  color: var(--text-dim);
}

/* Main Area */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-right: 260px;
}

html[dir="ltr"] .main-area {
  margin-right: 0;
  margin-left: 260px;
}

.topbar {
  height: 60px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}

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

.mobile-menu-btn {
  display: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  color: var(--text);
  line-height: 1;
}

.page-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.content {
  padding: 24px;
  flex: 1;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  animation: fadeIn 0.15s ease;
}

/* Cards & Grid */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  transition: border-color 0.15s ease;
}

.card:hover {
  border-color: #38383e;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 14.5px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

/* Stat Card */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s ease;
  position: relative;
}

.stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  background: #ffffff;
  opacity: 0.2;
  transition: opacity 0.15s ease;
}

html[dir="ltr"] .stat-card::after {
  right: auto;
  left: 0;
}

.stat-card:hover {
  border-color: #44444a;
}

.stat-card:hover::after {
  opacity: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-family: var(--font);
}

.stat-sub {
  font-size: 11px;
  color: var(--text-dim);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  transition: var(--transition);
  line-height: 1;
  text-decoration: none;
}

.btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-focus);
  transform: translateY(-1px);
}

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

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  background: #ffffff;
  color: #000000;
  border: 1px solid #ffffff;
  font-weight: 700;
}

.btn-primary:hover {
  background: #e5e5ea;
  border-color: #e5e5ea;
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(255, 69, 58, 0.1);
  color: #ff453a;
  border: 1px solid rgba(255, 69, 58, 0.3);
}

.btn-danger:hover {
  background: #ff453a;
  color: #ffffff;
  border-color: #ff453a;
  transform: translateY(-1px);
}

.btn-success {
  background: #141417;
  color: #ffffff;
  border: 1px solid #2e2e33;
}

.btn-success:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Inputs & Form Controls */
.input, .select, .textarea,
select, textarea,
input[type="text"], input[type="password"], input[type="search"], input[type="number"], input[type="url"], input[type="email"] {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13.5px;
  transition: var(--transition);
  outline: none;
  box-sizing: border-box;
}

.input:focus, .select:focus, .textarea:focus,
select:focus, textarea:focus,
input[type="text"]:focus, input[type="password"]:focus, input[type="search"]:focus {
  border-color: #ffffff;
  box-shadow: 0 0 0 1px #ffffff;
  background: var(--surface);
}

.textarea, textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row, .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  width: 100%;
}

.form-row label, .form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 13px;
}

html[dir="ltr"] table {
  text-align: left;
}

thead {
  background: var(--surface-2);
}

th {
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: var(--surface-hover);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-success {
  background: #121215;
  color: #ffffff;
  border: 1px solid #2e2e33;
}

.badge-warning {
  background: #141416;
  color: #e4e4e7;
  border: 1px solid #333338;
}

.badge-danger {
  background: rgba(255, 69, 58, 0.12);
  color: #ff453a;
  border: 1px solid rgba(255, 69, 58, 0.3);
}

.badge-info {
  background: #121215;
  color: #ffffff;
  border: 1px solid #27272a;
}

.badge-muted {
  background: #0d0d0f;
  color: var(--text-dim);
  border: 1px solid var(--border);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  padding: 20px;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  padding: 24px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-backdrop.open .modal {
  transform: none;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 60;
  pointer-events: none;
}

html[dir="ltr"] .toast-container {
  left: auto;
  right: 24px;
}

.toast {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.success {
  border-color: #ffffff;
}

.toast.error {
  border-color: #ff453a;
  color: #ff453a;
}

/* Login Page */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 30px;
  text-align: center;
}

.login-logo {
  width: 64px !important;
  height: 64px !important;
  max-width: 64px !important;
  min-width: 64px !important;
  border-radius: var(--radius-full);
  margin: 0 auto 16px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 26px;
}

/* Utilities */
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.muted {
  color: var(--text-muted);
}

.empty-state {
  padding: 36px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13.5px;
}

.loading-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* Telegram Preview */
.tg-preview {
  background: #09090b;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 0);
  background-size: 16px 16px;
}

.tg-bubble {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px 12px 2px 12px;
  padding: 14px 18px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 85%;
  align-self: flex-start;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

html[dir="ltr"] .tg-bubble {
  border-radius: 12px 12px 12px 2px;
}

.tg-kb-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 85%;
}

.tg-kb-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 14px;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 500;
  text-align: center;
  transition: var(--transition);
}

.tg-kb-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   Comprehensive Mobile & Tablet Responsiveness Optimization
   ========================================================================== */

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 45;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    height: 100dvh;
    width: 280px;
    max-width: 85vw;
    z-index: 50;
    transform: translateX(100%);
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.7);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }

  html[dir="ltr"] .sidebar {
    right: auto;
    left: 0;
    transform: translateX(-100%);
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.7);
  }

  .sidebar.open {
    transform: translateX(0) !important;
  }

  .main-area {
    margin-right: 0 !important;
    margin-left: 0 !important;
    width: 100%;
  }

  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
  }

  .topbar {
    padding: 0 14px;
    height: 58px;
  }

  .page-title {
    font-size: 16px;
    font-weight: 700;
  }

  .topbar-right {
    gap: 10px;
  }

  .content {
    padding: 16px 12px 32px 12px;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .card {
    padding: 16px 14px;
    border-radius: var(--radius-sm);
  }

  .card-header {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
  }

  .card-title {
    font-size: 15px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }

  .metric-card {
    padding: 12px 14px;
  }

  .metric-value {
    font-size: 20px;
  }

  .metric-label {
    font-size: 11.5px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .toolbar input, .toolbar select, .toolbar button {
    width: 100% !important;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    margin: 0 -4px;
  }

  table {
    min-width: 520px;
    font-size: 12.5px;
  }

  th, td {
    padding: 9px 10px;
    white-space: nowrap;
  }

  /* Touch-friendly inputs & font sizing to prevent iOS Safari auto-zoom */
  .input, .select, .textarea,
  input[type="text"], input[type="password"], input[type="search"], select, textarea {
    font-size: 15px !important;
    padding: 11px 12px !important;
    min-height: 44px;
  }

  .btn {
    min-height: 42px;
    padding: 9px 16px;
    font-size: 13.5px;
    touch-action: manipulation;
  }

  .modal {
    width: 95% !important;
    max-width: 95% !important;
    max-height: 90vh;
    max-height: 90dvh;
    padding: 18px 16px;
    border-radius: 14px;
    margin: auto;
  }

  .toast-container {
    left: 14px !important;
    right: 14px !important;
    bottom: 20px !important;
    width: auto !important;
    max-width: 100% !important;
  }

  .toast {
    width: 100%;
    padding: 12px 16px;
    font-size: 13px;
  }

  /* Donut chart wrap on mobile */
  .donut-chart-wrap {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .donut-legend {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: 1fr !important;
  }

  .login-card {
    padding: 26px 18px;
    margin: 14px;
    border-radius: 14px;
  }

  .topbar {
    padding: 0 10px;
  }

  #lang-toggle-btn {
    padding: 5px 8px;
    font-size: 11px;
  }

  #bot-status-pill {
    display: none;
  }

  .brand-title {
    font-size: 15px;
  }

  .content {
    padding: 12px 8px 28px 8px;
  }
}

/* Resource Meters & Progress Bars */
.meter-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.meter-label {
  font-weight: 600;
  color: var(--text);
}

.meter-val {
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.meter-badge {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}

.meter-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Donut Chart Component */
.donut-chart-wrap {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 20px;
  padding: 16px;
  flex-wrap: wrap;
}

.donut-svg-box {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-segment {
  transition: stroke-width 0.3s ease, opacity 0.3s ease;
  cursor: pointer;
}

.donut-segment:hover {
  opacity: 0.85;
}

.donut-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.donut-center-val {
  font-size: 24px;
  font-weight: 800;
  color: #fafafa;
  line-height: 1;
}

.donut-center-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 170px;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.donut-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.donut-legend-label {
  flex-grow: 1;
  color: var(--text-dim);
}

.donut-legend-val {
  color: var(--text);
  font-weight: 600;
}

/* High Fidelity Telegram Mockup */
.tg-chat-frame {
  background: #0f141c;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.tg-chat-header {
  background: #17212b;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tg-chat-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
}

.tg-chat-sub {
  font-size: 11px;
  color: #5288c1;
}

.tg-chat-viewport {
  padding: 20px 16px;
  min-height: 190px;
  background-color: #0e1621;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 0);
  background-size: 18px 18px;
  display: flex;
  flex-direction: column;
}

.tg-message-row {
  max-width: 82%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: flex-start;
}

.tg-message-bubble {
  background: #182533;
  border-radius: 12px 12px 2px 12px;
  padding: 12px 16px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tg-sender-name {
  color: #64b5f6;
  font-weight: 700;
  font-size: 12.5px;
  margin-bottom: 6px;
}

.tg-message-text {
  color: #f5f5f5;
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
}

.tg-message-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

.tg-msg-status {
  color: #64b5f6;
  font-weight: 700;
  font-size: 11px;
}

.tg-msg-keyboard {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.tg-msg-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 8px 12px;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.tg-msg-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.25);
}

.tg-msg-btn.tg-btn-primary {
  background: #2481cc;
  border-color: #2481cc;
  color: #ffffff;
}
.tg-msg-btn.tg-btn-primary:hover {
  background: #1f72b5;
  border-color: #1f72b5;
}

.tg-msg-btn.tg-btn-success {
  background: #2fab52;
  border-color: #2fab52;
  color: #ffffff;
}
.tg-msg-btn.tg-btn-success:hover {
  background: #289647;
  border-color: #289647;
}

.tg-msg-btn.tg-btn-danger {
  background: #e53935;
  border-color: #e53935;
  color: #ffffff;
}
.tg-msg-btn.tg-btn-danger:hover {
  background: #c62828;
  border-color: #c62828;
}

/* Preset Buttons */
.preset-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.preset-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
}

.preset-btn:hover, .preset-btn.active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

/* Interactive Guide Cards & Walkthrough */
.guide-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.guide-hero {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.guide-step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.25s ease, border-color 0.25s ease;
  animation: slideUp 0.4s ease backwards;
}

.guide-step-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.guide-step-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.guide-step-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.guide-step-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.guide-mockup {
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-tg-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #64b5f6;
}

/* ==========================================================================
   Instagram Automation Pro-Max Redesign Styles
   ========================================================================== */
.ig-bento-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 1024px) {
  .ig-bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ig-bento-span-2 {
    grid-column: span 2;
  }
}

.ig-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  gap: 1.25rem;
  flex-wrap: wrap;
}

.ig-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
}

.ig-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

.ig-pulse-dot.disconnected {
  background: #ff453a;
  box-shadow: 0 0 6px rgba(255, 69, 58, 0.5);
}

.ig-scenario-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: border-color 0.15s ease;
  position: relative;
  overflow: hidden;
}

.ig-scenario-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  background: #ffffff;
  opacity: 0.3;
  transition: opacity 0.15s ease;
}

html[dir="ltr"] .ig-scenario-card::before {
  right: auto;
  left: 0;
}

.ig-scenario-card:hover {
  border-color: #38383e;
}

.ig-scenario-card:hover::before {
  opacity: 1;
}

.ig-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  background: #141417;
  border: 1px solid #222226;
  color: #a1a1aa;
}

.ig-tag-comment {
  background: #141417;
  border-color: #27272a;
  color: #ffffff;
}

.ig-tag-dm {
  background: #141417;
  border-color: #27272a;
  color: #d4d4d8;
}

.ig-tag-followgate {
  background: #18181b;
  border-color: #333338;
  color: #ffffff;
}

.ig-step-box {
  background: #0d0d0f;
  border: 1px solid #1f1f23;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.6;
}

.ig-badge-event {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: #141417;
  border: 1px solid #222226;
  color: #ffffff;
}

.ig-badge-event.comment_received,
.ig-badge-event.dm_received,
.ig-badge-event.dm_sent {
  background: #141417;
  color: #ffffff;
  border: 1px solid #27272a;
}

.ig-badge-event.follow_gate {
  background: #18181b;
  color: #e4e4e7;
  border: 1px solid #333338;
}

.ig-badge-event.error {
  background: rgba(255, 69, 58, 0.12);
  color: #ff453a;
  border: 1px solid rgba(255, 69, 58, 0.3);
}

.ig-action-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
