/* ============================================================
 *  layout.css — چیدمان کلی + تب‌های عمودی
 * ============================================================ */

#app {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  direction: rtl;
}

/* ═══ تب‌های عمودی ═══ */
#tabs-rail {
  width: 74px;
  min-width: 74px;
  background: var(--bg-tab);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 4px;
  transition: background 0.3s;
  z-index: 5;
}

.tab-logo {
  font-size: 26px;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 12px var(--color-profit-glow));
}

.tab-btn {
  width: 62px;
  height: 62px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: Tahoma, sans-serif;
  position: relative;
  padding: 0;
}

.tab-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tab-btn .tab-icon {
  font-size: 22px;
  line-height: 1;
}

.tab-btn .tab-label {
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.2px;
}

.tab-btn.active {
  background: var(--bg-tab-active);
  color: var(--color-profit);
  box-shadow: inset 0 0 0 1px var(--border-color);
}

.tab-btn.active::before {
  content: '';
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 30px;
  background: var(--color-profit);
  border-radius: 3px 0 0 3px;
  box-shadow: 0 0 12px var(--color-profit-glow);
}

.tab-spacer {
  flex: 1;
}

.theme-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
}

.theme-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

/* ═══ سایدبار (پنل تب‌ها) ═══ */
#sidebar {
  width: 400px;
  min-width: 400px;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  transition: background 0.3s, border-color 0.3s;
}

.tab-content {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.tab-content.active {
  display: flex;
}

.panel-header {
  padding: 16px 18px;
  background: var(--bg-panel-2);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.panel-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: bold;
  color: var(--text-primary);
}

.panel-badge {
  background: var(--gradient-profit);
  color: #fff;
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 12px;
  font-weight: bold;
  box-shadow: 0 0 10px var(--color-profit-glow);
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 20px;
}

/* ═══ ناحیه نقشه ═══ */
#map-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#map {
  height: 100%;
  width: 100%;
  background: var(--bg-app);
}

/* ═══ ریسپانسیو ═══ */
@media (max-width: 1000px) {
  #sidebar { width: 340px; min-width: 340px; }
  #tabs-rail { width: 64px; min-width: 64px; }
  .tab-btn { width: 54px; height: 54px; }
  .tab-btn .tab-icon { font-size: 18px; }
  .tab-btn .tab-label { font-size: 9px; }
}

@media (max-width: 780px) {
  #app { flex-direction: column; }
  #tabs-rail {
    flex-direction: row;
    width: 100%;
    min-width: 100%;
    height: 64px;
    padding: 0 8px;
    border-left: none;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
  }
  .tab-logo { margin: 0 10px 0 0; font-size: 22px; }
  .tab-btn { width: 56px; height: 56px; }
  .tab-btn .tab-label { font-size: 11px; }
  .tab-btn.active::before { display: none; }
  .tab-spacer { display: none; }
  #sidebar {
    width: 100%;
    min-width: 100%;
    height: 48vh;
    height: 48dvh;
    border-left: none;
    border-bottom: 1px solid var(--border-color);
  }
  #map-wrap { height: 52vh; height: 52dvh; }
}  
