/* ====== پایه ====== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  overflow: hidden;
  color: var(--text);
  background: var(--bg);
  transition: background .6s ease, color .6s ease;
}

body { position: relative; }

/* لایه پس‌زمینه طبیعت */
.bg-layer {
  position: fixed;
  inset: 0;
  background: var(--bg-image);
  background-size: cover;
  background-position: center;
  transition: opacity .8s ease, background .8s ease;
  z-index: 0;
  opacity: var(--bg-opacity, 1);
}
.bg-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg-overlay);
  transition: background .8s ease;
}

/* ====== چیدمان کلی ====== */
.app {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: grid;
  grid-template-columns: auto auto 1fr; /* RTL: icon-sidebar | panel | main */
  gap: 16px;
  padding: 16px;
}

/* ====== محتوای اصلی ====== */
.main-content {
  overflow-y: auto;
  padding: 8px 4px 40px 4px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scrollbar-width: thin;
}
.main-content::-webkit-scrollbar { width: 6px; }
.main-content::-webkit-scrollbar-thumb {
  background: var(--scroll);
  border-radius: 8px;
}

/* ردیف بالا */
.top-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 1100px) {
  .top-row { grid-template-columns: 1fr; }
}

/* ویجت پایه */
.widget {
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 20px;
  transition: background .6s ease, border-color .6s ease, box-shadow .4s ease;
  box-shadow: var(--shadow);
}

/* عنوان محیط */
.env-header {
  padding: 4px 8px;
}
.env-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  transition: color .6s ease;
}
.env-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  transition: color .6s ease;
}

/* اسکرول‌بار کلی */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--scroll);
  border-radius: 8px;
}