/* ===============================
   BottelX Dashboard Theme
   Scoped – SAFE for Landing
================================ */

.app-dashboard {
  --bg-main: #020617;
  --bg-panel: rgba(15, 23, 42, 0.75);
  --bg-card: rgba(30, 41, 59, 0.65);
  --border: rgba(255, 255, 255, 0.08);
  --accent: #6366f1;
  --accent-2: #22d3ee;
  --text-main: #e5e7eb;
  --text-muted: #94a3b8;
  --danger: #ef4444;
  --success: #22c55e;

  background: radial-gradient(
      1200px 600px at 50% -10%,
      #1e293b 0%,
      transparent 60%
    ),
    linear-gradient(180deg, #020617, #020617);
  min-height: 100vh;
  color: var(--text-main);
}

/* ===============================
   Layout
================================ */

.app-dashboard main {
  background: transparent;
}

/* ===============================
   Sidebar
================================ */

.app-dashboard #sidebar {
  background: linear-gradient(
    180deg,
    rgba(2, 6, 23, 0.95),
    rgba(2, 6, 23, 0.85)
  );
  border-right: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.app-dashboard #sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.app-dashboard #sidebar a:hover {
  background: rgba(99, 102, 241, 0.12);
  color: #fff;
  transform: translateX(4px);
}

.app-dashboard #sidebar a.active {
  background: linear-gradient(
    90deg,
    rgba(99, 102, 241, 0.25),
    rgba(34, 211, 238, 0.15)
  );
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.35);
}

/* RTL Sidebar fix */
[dir='rtl'] .app-dashboard #sidebar a:hover {
  transform: translateX(-4px);
}

/* ===============================
   Top Stats Cards
================================ */

.app-dashboard .stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(12px);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.app-dashboard .stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    300px circle at var(--x, 50%) var(--y, 50%),
    rgba(99, 102, 241, 0.18),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.3s;
}

.app-dashboard .stat-card:hover::after {
  opacity: 1;
}

.app-dashboard .stat-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

/* ===============================
   Cards / Panels
================================ */

.app-dashboard .card,
.app-dashboard .panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  backdrop-filter: blur(14px);
}

.app-dashboard .card-title {
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  margin-bottom: 6px;
}

.app-dashboard .card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===============================
   Tables
================================ */

.app-dashboard table {
  width: 100%;
  border-collapse: collapse;
}

.app-dashboard th {
  text-align: left;
  font-size: 12px;
  color: var(--text-muted);
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.app-dashboard td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 14px;
}

.app-dashboard tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* ===============================
   Buttons
================================ */

.app-dashboard .btn {
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.app-dashboard .btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.35);
}

.app-dashboard .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(99, 102, 241, 0.45);
}

.app-dashboard .btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fecaca;
}

.app-dashboard .btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* ===============================
   Badges
================================ */

.app-dashboard .badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}

.app-dashboard .badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

.app-dashboard .badge-warning {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
}

.app-dashboard .badge-danger {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

/* ===============================
   Charts container
================================ */

.app-dashboard .chart-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

/* ===============================
   Responsive
================================ */

@media (max-width: 768px) {
  .app-dashboard #sidebar {
    position: fixed;
    inset-inline-start: 0;
    top: 0;
    height: 100vh;
    z-index: 40;
  }

  .app-dashboard main {
    padding: 16px;
  }
}
/* ===============================
   Dashboard Skeleton (Scoped)
================================ */

.app-dashboard .skeleton {
  position: relative;
  overflow: hidden;
}

.app-dashboard .skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.08),
    transparent
  );
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.app-dashboard .skeleton-row {
  height: 56px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.app-dashboard .skeleton-chart {
  height: 260px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
}

/* ===============================
   Automation Row
================================ */

.app-dashboard .automation-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.2s;
}

.app-dashboard .automation-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.app-dashboard .stat-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}
/* ===============================
   Skeleton Loader (Shimmer)
================================ */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.18),
    transparent
  );
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.skeleton-text {
  height: 14px;
  width: 100%;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 20px;
  width: 50%;
  margin-bottom: 12px;
}

.skeleton-card {
  height: 96px;
}

.skeleton-chart {
  height: 260px;
}
/* ===============================
   Sidebar
================================ */
/* ===============================
   Sidebar - Updated
================================ */

.app-sidebar {
  width: 260px;
  min-height: 100vh;
  padding: 0;
  background: linear-gradient(
    180deg,
    rgba(2, 6, 23, 0.95),
    rgba(2, 6, 23, 0.85)
  );
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin: 4px 8px;
  border-radius: 10px;
  color: #94a3b8;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px;
  position: relative;
  overflow: hidden;
}

.sidebar-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: linear-gradient(to bottom, #6366f1, #06b6d4);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 0 3px 3px 0;
}

.sidebar-link:hover {
  background: rgba(99, 102, 241, 0.12);
  color: #fff;
  transform: translateX(4px);
}

.sidebar-link:hover::before {
  opacity: 1;
}

.sidebar-link.active {
  background: linear-gradient(
    90deg,
    rgba(99, 102, 241, 0.25),
    rgba(34, 211, 238, 0.15)
  );
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.35),
    0 4px 12px rgba(99, 102, 241, 0.15);
}

.sidebar-link.active::before {
  opacity: 1;
}

.sidebar-link.danger {
  color: #f87171;
  margin-top: 20px;
}

.sidebar-link.danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

.sidebar-divider {
  margin: 20px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* آیکون‌ها */
.sidebar-link .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* دکمه بستن سایدبار */
#closeSidebar {
  transition: all 0.2s ease;
  z-index: 40;
}

#closeSidebar:hover {
  transform: rotate(90deg);
  color: #fff;
}

/* دکمه Create New */
.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

/* RTL Support */
[dir='rtl'] .sidebar-link:hover {
  transform: translateX(-4px);
}

[dir='rtl'] .sidebar-link::before {
  left: 0;
  right: auto;
  border-radius: 3px 0 0 3px;
}

/* انیمیشن برای آیتم فعال */
@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Automation row */
/* Automation row hover */
.automation-row {
  transition: all 0.25s ease;
}
.automation-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* Status pill */
.status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.status-active {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

.status-inactive {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
}

/* Icon buttons */
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  color: #e5e7eb;
}

.icon-btn:hover {
  background: rgba(99, 102, 241, 0.18);
  transform: translateY(-1px);
}

.icon-btn.config:hover {
  background: rgba(34, 211, 238, 0.18);
}
/* Execution rows */
.execution-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Error status */
.status-error {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

/* Table */
.app-dashboard table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.log-new {
  animation: pulseBg 1.2s ease-out;
}

@keyframes pulseBg {
  0% {
    background: rgba(99, 102, 241, 0.25);
  }
  100% {
    background: transparent;
  }
}
.app-dashboard .input,
.app-dashboard .select {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 6px 10px;
  color: #e5e7eb;
  font-size: 13px;
}

.app-dashboard .input::placeholder {
  color: #94a3b8;
}

.app-dashboard .select option {
  background: #020617;
}
/* Tabs */
.profile-tabs {
  display: flex;
  gap: 12px;
}

.tab-btn {
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.2s;
}

.tab-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #e5e7eb;
}

.tab-btn.active {
  background: rgba(99, 102, 241, 0.25);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.5);
}

/* Inputs */
.label {
  display: block;
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 6px;
}

.input {
  width: 100%;
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 14px;
  color: #fff;
}

.input:focus {
  outline: none;
  border-color: #6366f1;
}

.input-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Panel */
.panel {
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.7));
  border-radius: 18px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Utility */
.hidden {
  display: none;
}
.input-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.5);
}
#ticketModal .panel {
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

#messagesBox {
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  border-radius: 8px;
}

.message {
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.message.user {
  background: rgba(255, 255, 255, 0.05);
}

.message.admin {
  background: rgba(16, 185, 129, 0.15);
  border-left: 3px solid #10b981;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal-card {
  position: relative;
  max-width: 720px;
  margin: 5vh auto;
  background: #0f172a;
  border-radius: 12px;
  padding: 20px;
}
.diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.diff-table th {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  color: #4a5568;
}

.diff-table td {
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  vertical-align: top;
}

.diff-table tr:nth-child(even) {
  background-color: #f9fafb;
}

.diff-table tr:hover {
  background-color: #f1f5f9;
}

.empty-state {
  padding: 20px;
  text-align: center;
  color: #f8cebb;
  font-style: italic;
}

.changed-field {
  background-color: #fff7ed;
  border-left: 3px solid #ed8936 !important;
}

.added-field {
  background-color: #f0fff4;
  border-left: 3px solid #48bb78 !important;
}

.removed-field {
  background-color: #fff5f5;
  border-left: 3px solid #f56565 !important;
}
/* استایل‌های اضافی برای audit log */
.group-header {
  position: relative;
}

.group-header::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #3b82f6;
}

.added-field {
  background-color: rgba(34, 197, 94, 0.1) !important;
  border-left: 3px solid #22c55e !important;
}

.removed-field {
  background-color: rgba(239, 68, 68, 0.1) !important;
  border-left: 3px solid #ef4444 !important;
}

.changed-field {
  background-color: rgba(245, 158, 11, 0.1) !important;
  border-left: 3px solid #f59e0b !important;
}

.diff-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #f2ffc4;
}

.diff-table th {
  text-align: left;
  padding: 8px 12px;
  background-color: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  font-weight: 600;
  color: #010b1a;
}

.diff-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.diff-table tr:hover {
  background-color: #f8fafc;
}

.empty-state {
  padding: 20px;
  text-align: center;
  color: #90bcfa;
  font-style: italic;
}
/* در فایل CSS خود اضافه کنید */
.panel {
  transition: all 0.2s ease;
  border: 1px solid rgba(75, 85, 99, 0.3);
}

.panel:hover {
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fade-in 0.3s ease-out;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-btn.config:hover {
  background-color: rgba(59, 130, 246, 0.2);
  transform: scale(1.1);
}
